nova.crypto.revoke_cert always raises ProjectNotFound

Bug #1376368 reported by Alex Gaynor
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Critical
Russell Bryant
OpenStack Security Advisory
Won't Fix
Undecided
Unassigned

Bug Description

(Marked this as a security issue for now, since cert revocation not working is pretty serious)

https://github.com/openstack/nova/blob/master/nova/crypto.py#L277-L278

os.chdir *always* returns None, which means that path is always taken and the cert is never revoked

Changed in ossa:
status: New → Incomplete
Revision history for this message
Tristan Cacqueray (tristan-cacqueray) wrote :

Thanks for the report, the OSSA task have been set to incomplete pending additional security reviews.

Well os.chdir will raise an exception if the directory is not existent...
Yet the revocation code seems to be unreachable!

Revision history for this message
Jeremy Stanley (fungi) wrote :

Do we know if this affects stable/icehouse? If not, then we can just open and hopefully expedite the fix into rc2.

Revision history for this message
Alex Gaynor (alex-gaynor) wrote :

The commit that introduced the bug, as far as I can tell is from June, I'm not sure it was also backported.

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

This was apparently not backported:
https://github.com/openstack/nova/blob/stable/icehouse/nova/crypto.py#L277-L278

Let's see if we can quickly get a patch proposed before we open it.

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

Only in Juno, so if fixed before reolease, won't trigger an OSSA

information type: Private Security → Public Security
tags: added: juno-rc-potential
Changed in nova:
importance: Undecided → Critical
status: New → Confirmed
Changed in ossa:
status: Incomplete → Won't Fix
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

ttx,

referenced lines were added, then modified by https://review.openstack.org/#/c/99373/5/nova/crypto.py,unified in response to this "bug" https://bugs.launchpad.net/nova/+bug/883320

-- dims

Changed in nova:
assignee: nobody → Davanum Srinivas (DIMS) (dims-v)
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-rc2
Thierry Carrez (ttx)
tags: removed: juno-rc-potential
Changed in nova:
assignee: Davanum Srinivas (DIMS) (dims-v) → Russell Bryant (russellb)
milestone: juno-rc2 → kilo-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Confirmed → In Progress
Thierry Carrez (ttx)
Changed in nova:
milestone: kilo-1 → juno-rc2
no longer affects: nova/juno
Changed in nova:
assignee: Russell Bryant (russellb) → Davanum Srinivas (DIMS) (dims-v)
Changed in nova:
assignee: Davanum Srinivas (DIMS) (dims-v) → Russell Bryant (russellb)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Davanum Srinivas (dims) (<email address hidden>) on branch: master
Review: https://review.openstack.org/126409
Reason: Oh well! :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/126890
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c8538208da00c3b0d0646629c9d668aa69944b85
Submitter: Jenkins
Branch: master

commit c8538208da00c3b0d0646629c9d668aa69944b85
Author: Russell Bryant <email address hidden>
Date: Wed Oct 8 12:14:31 2014 +0000

    Fix broken cert revocation

    Cert revocation was broken by
    32b0adb591f80ad2c5c19519b4ffc2b55dbea672. os.chdir() never returns
    anything, so this method would always raise an exception. The proper
    way to handle an error from os.chdir() is to catch OSError.

    There were existing tests for this code, but they conveniently mocked
    os.chdir() to return values that are never actually returned. The
    tests were fixed to match the real behavior.

    Change-Id: I7549bb60a7d43d53d6f81eecea31cbb9720cc8b6
    Closes-bug: #1376368

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (proposed/juno)

Fix proposed to branch: proposed/juno
Review: https://review.openstack.org/127144

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (proposed/juno)

Reviewed: https://review.openstack.org/127144
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3f9003270efd9ac036f3c229b36baa0bb05203bf
Submitter: Jenkins
Branch: proposed/juno

commit 3f9003270efd9ac036f3c229b36baa0bb05203bf
Author: Russell Bryant <email address hidden>
Date: Wed Oct 8 12:14:31 2014 +0000

    Fix broken cert revocation

    Cert revocation was broken by
    32b0adb591f80ad2c5c19519b4ffc2b55dbea672. os.chdir() never returns
    anything, so this method would always raise an exception. The proper
    way to handle an error from os.chdir() is to catch OSError.

    There were existing tests for this code, but they conveniently mocked
    os.chdir() to return values that are never actually returned. The
    tests were fixed to match the real behavior.

    Change-Id: I7549bb60a7d43d53d6f81eecea31cbb9720cc8b6
    Closes-bug: #1376368
    (cherry picked from commit c8538208da00c3b0d0646629c9d668aa69944b85)

Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-rc2 → 2014.2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)
Download full text (7.7 KiB)

Reviewed: https://review.openstack.org/128894
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9825784742d010a902ff149765269ad32a8a0dfd
Submitter: Jenkins
Branch: master

commit 7c9aa6da92805f20083203a6ec8f93b1b592fc13
Author: He Jie Xu <email address hidden>
Date: Sun Oct 5 00:20:01 2014 +0800

    Fix pci_request_id break the upgrade from icehouse to juno

    commit a8a5d44c8aca218f00649232c2b8a46aee59b77e add pci_request_id
    as one item for the request_network tuple. But the icehouse code
    assume only three items in the tuple.

    This patch filters pci_request_id out from the tuple.

    Cherry-Pick from:
    https://review.openstack.org/#/c/126144/6

    Change-Id: I991e1c68324fe92fac647583f3ec8f6aec637913
    Closes-Bug: #1377447

commit 10a5eecd0973096b57efd31f8b27d7295a44ab89
Author: Andreas Jaeger <email address hidden>
Date: Thu Oct 9 12:22:36 2014 +0200

    Updated translations

    Commands run:-
    $ python setup.py extract_messages
    $ python setup.py update_catalog --no-fuzzy-matching \
      --ignore-obsolete=true
    $ source \
      ../openstack-infra/project-config/jenkins/scripts/common_translation_update.sh
    $ setup_loglevel_vars
    $ cleanup_po_file nova

    Change-Id: I64b2b468f7edd44dbb445b5b4e68b65c3fa53d9e

commit 3f9003270efd9ac036f3c229b36baa0bb05203bf
Author: Russell Bryant <email address hidden>
Date: Wed Oct 8 12:14:31 2014 +0000

    Fix broken cert revocation

    Cert revocation was broken by
    32b0adb591f80ad2c5c19519b4ffc2b55dbea672. os.chdir() never returns
    anything, so this method would always raise an exception. The proper
    way to handle an error from os.chdir() is to catch OSError.

    There were existing tests for this code, but they conveniently mocked
    os.chdir() to return values that are never actually returned. The
    tests were fixed to match the real behavior.

    Change-Id: I7549bb60a7d43d53d6f81eecea31cbb9720cc8b6
    Closes-bug: #1376368
    (cherry picked from commit c8538208da00c3b0d0646629c9d668aa69944b85)

commit 6ed57972093835f449ad645b3783bbb8b3c4245e
Author: Russell Bryant <email address hidden>
Date: Fri Oct 3 16:41:03 2014 -0400

    Update rpc version aliases for juno

    Update all of the rpc client API classes to include a version alias
    for the latest version implemented in Juno. This alias is needed when
    doing rolling upgrades from Juno to Kilo. With this in place, you can
    ensure all services only send messages that both Juno and Kilo will
    understand.

    Closes-bug: #1378786
    Change-Id: Ia81538130bf8530b70b5f55c7a3d565903ff54b4
    (cherry picked from commit f98d725103c53e767a1cddb0b7e2c3822309db17)

commit ee3594072a7ef1c3f5661021fb31118069cbd646
Author: Tristan Cacqueray <email address hidden>
Date: Fri Oct 3 19:53:42 2014 +0000

    Mask passwords in exceptions and error messages

    When a ProcessExecutionError is thrown by processutils.ssh_execute(),
    the exception may contain information such as password. Upstream
    applications that just log the message (as several appear to do)
    could inadvertently expose these passwords to a u...

Read more...

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.