CWE
362
Advisory Published
Updated

REDHAT-BUG-844442: Race Condition

First published: Mon Jul 30 2012(Updated: )

The sudo packages in Red Hat Enterprise Linux 5 contained a %postun script (executed during the package removal or upgrade) that created a temporary file insecurely. The script did the following: # Remove the "sudoers:" line from nsswitch.conf if it's not modified if grep -q "^sudoers: files ldap$" ""/etc/nsswitch.conf""; then rm -f ""/var/tmp/nsswitch.conf.bak"" &amp;&amp; \ touch ""/var/tmp/nsswitch.conf.bak"" &amp;&amp; \ grep -v "^sudoers: files ldap$" ""/etc/nsswitch.conf"" &gt; ""/var/tmp/nsswitch.conf.bak"" &amp;&amp; \ mv -f ""/var/tmp/nsswitch.conf.bak"" ""/etc/nsswitch.conf"" fi There was a race condition between the removal of the temporary file and its re-creation using touch. A local attacker could possibly use this to create nsswitch.conf.bak file or symlink after rm -f "/var/tmp/nsswitch.conf.bak" was run and cause the script to overwrite arbitrary file with the contents of the /etc/nsswitch.conf file, or make the script create /etc/nsswitch.conf file with attacker controlled content and permissions. The attack would have to be executed during the sudo package upgrade or removal. This problem was introduced in the sudo erratum RHSA-2012:0309 which was released in Red Hat Enterprise Linux 5.8: <a href="https://rhn.redhat.com/errata/RHSA-2012-0309.html">https://rhn.redhat.com/errata/RHSA-2012-0309.html</a> The sudo packages in other Red Hat Enterprise Linux versions did not include this %postun script and were not affected this issue.

Affected SoftwareAffected VersionHow to fix
Red Hat Enterprise Linux>=5.8
Red Hat Sudo

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is the severity of REDHAT-BUG-844442?

    REDHAT-BUG-844442 is considered a medium severity vulnerability due to its potential to allow unauthorized file access.

  • How do I fix REDHAT-BUG-844442?

    To fix REDHAT-BUG-844442, update the sudo package to the latest version available for Red Hat Enterprise Linux 5.

  • What versions of software are affected by REDHAT-BUG-844442?

    REDHAT-BUG-844442 affects the sudo package in Red Hat Enterprise Linux 5, specifically versions prior to the recommended updates.

  • What does the %postun script do in the context of REDHAT-BUG-844442?

    The %postun script in REDHAT-BUG-844442 executes during package removal or upgrade and creates a temporary file insecurely.

  • Is the vulnerability REDHAT-BUG-844442 unique to a particular configuration?

    REDHAT-BUG-844442 can affect any system running the specified versions of sudo in Red Hat Enterprise Linux 5 that utilize the vulnerable script.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2025 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203