/etc/neutron/secret.txt is world readable

Bug #1847230 reported by James Troup
260
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Neutron Open vSwitch Charm
Fix Released
High
James Page

Bug Description

/etc/neutron/secret.txt is created world readable. Presumably it shouldn't be?

Revision history for this message
James Troup (elmo) wrote :

root@wpz230807rc:/etc/neutron# ls -l secret.txt
-rw-r--r-- 1 root root 36 Aug 19 17:34 secret.txt
root@wpz230807rc:/etc/neutron# su - nobody -s /bin/bash
No directory, logging in with HOME=/
nobody@wpz230807rc:/$ cat /etc/neutron/secret.txt > /dev/null
nobody@wpz230807rc:/$

Revision history for this message
James Page (james-page) wrote :

Confirmed; file is created world readable.

The UUID it contains is used on the relation to nova-compute to setup the shared secret for comms between the local neutron-metadata-agent and nova-api-metadata service.

Only the charm needs to be able to read it so a) it should really be in /var/lib/charm/<charm-name> and b) group and world permissions can be disabled safely

Changed in charm-neutron-openvswitch:
status: New → Confirmed
importance: Undecided → High
milestone: none → 19.10
Revision history for this message
James Page (james-page) wrote :

This could be used as an exploit if you had access to the local unit; crafting the correct http request using this shared secret could be used to retrieve instance metadata from the nova-api-metadata service.

Changed in charm-neutron-openvswitch:
status: Confirmed → In Progress
assignee: nobody → James Page (james-page)
James Page (james-page)
information type: Private Security → Public Security
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to charm-neutron-openvswitch (master)

Reviewed: https://review.opendev.org/687272
Committed: https://git.openstack.org/cgit/openstack/charm-neutron-openvswitch/commit/?id=47fb279533c425ca5c5f7f3f8fd993b3fa8c1e12
Submitter: Zuul
Branch: master

commit 47fb279533c425ca5c5f7f3f8fd993b3fa8c1e12
Author: James Page <email address hidden>
Date: Tue Oct 8 12:20:59 2019 +0100

    Ensure /etc/neutron/secret.txt is not world readable

    /etc/neutron/secret.txt is used to store the UUID to configure
    the shared secret in neutron-metadata-agent and the nova-api-metadata
    service for authentication of metadata requests from instances.

    Ensure that this file can only be read by the root user.

    Change-Id: I6a18ebabade887922c13824c23ad5e0a8da74ba8
    Closes-Bug: 1847230

Changed in charm-neutron-openvswitch:
status: In Progress → Fix Committed
David Ames (thedac)
Changed in charm-neutron-openvswitch:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.