Insecure temp file usage in vanilla plugin

Bug #1370298 reported by Travis McPeak
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Security Advisory
Invalid
Undecided
Unassigned
Sahara
Fix Released
Critical
Andrew Lazarev

Bug Description

On this line: https://github.com/openstack/sahara/blob/master/sahara/plugins/vanilla/hadoop2/run_scripts.py#L79 a database file is being created in /tmp without any permissions set on it. Later on, in this line: https://github.com/openstack/sahara/blob/master/sahara/plugins/vanilla/hadoop2/run_scripts.py#L134 , the same file is being run as the root user on the mysql DB.

Since this file is not created with secure permissions, any user can read the contents or tamper with it. If the file is tampered with, an attacker can run arbitrary commands on the database, including any SQL queries. These queries might compromise confidentiality, or destroy data (integrity).

Secure files should be created securely, and any time files are created, they should have the most restrictive permissions possible set on them.

Changed in sahara:
milestone: none → kilo-1
status: New → Confirmed
Revision history for this message
Travis McPeak (travis-mcpeak) wrote :

OSSA?

Revision history for this message
Thierry Carrez (ttx) wrote :

We issue OSSAs only if the issue is present in a supported release. The first supported release of Sahara will be Juno.

So if this is fixed before Juno release (which I recommend), no OSSA is needed.

If this slips in the release and gets fixed after, then OSSA it will be.

@Sergey: any chance you could fix that before rc1 ? If you're reasonably sure, it may make sense to make that bug public so that you can post public review.

Changed in ossa:
status: New → Incomplete
Changed in sahara:
importance: Undecided → Critical
Revision history for this message
Jeremy Stanley (fungi) wrote :

According to https://wiki.openstack.org/wiki/Security_supported_projects the VMT only covers Sahara starting with the upcoming Juno release, so unless this bug survives into 2014.2 and is fixed in the stable/juno afterward we would not issue an OSSA for fixes to older Sahara releases. The Sahara developers are free to produce an advisory of their own for Icehouse and earlier releases, however.

Changed in sahara:
milestone: kilo-1 → juno-rc1
Revision history for this message
Sergey Lukjanov (slukjanov) wrote :

I think it should be fixed in Juno 100%, so, I'm opening this bug and removing OSSA from affected projects.

Changed in ossa:
status: Incomplete → Invalid
information type: Private Security → Public Security
Changed in sahara:
assignee: nobody → Andrew Lazarev (alazarev)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to sahara (master)

Fix proposed to branch: master
Review: https://review.openstack.org/123286

Changed in sahara:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sahara (master)

Reviewed: https://review.openstack.org/123286
Committed: https://git.openstack.org/cgit/openstack/sahara/commit/?id=38ff65d9b08b38a1516a1a3adaab86d3c318fe6b
Submitter: Jenkins
Branch: master

commit 38ff65d9b08b38a1516a1a3adaab86d3c318fe6b
Author: Andrew Lazarev <email address hidden>
Date: Mon Sep 22 16:53:36 2014 -0700

    [Vanilla] Increased security of temporary files for db

    * changed location of files from /tmp to ~
    * added code to remove file after use
    * refactored code to have all actions with files in one place

    Things that can be improved
    * remove code duplication around db actions

    Change-Id: I44657ae9331d4369e667c5dbc0d0f383b9b49cd5
    Closes-Bug: #1370298

Changed in sahara:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in sahara:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in sahara:
milestone: juno-rc1 → 2014.2
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.