CVE-2012-3440: Race Condition

Published Jul 30, 2012
·
Updated

A certain Red Hat script for sudo 1.7.2 on Red Hat Enterprise Linux (RHEL) 5 allows local users to overwrite arbitrary files via a symlink attack on the /var/tmp/nsswitch.conf.bak temporary file.

Other sources

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"" && \ touch ""/var/tmp/nsswitch.conf.bak"" && \ grep -v "^sudoers: files ldap$" ""/etc/nsswitch.conf"" > ""/var/tmp/nsswitch.conf.bak"" && \ 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:

https://rhn.redhat.com/errata/RHSA-2012-0309.html

The sudo packages in other Red Hat Enterprise Linux versions did not include this %postun script and were not affected this issue.

Affected Software

2 affected components
Todd Miller Sudo=1.7.2
redhat Enterprise Linux=5

Event History

Jul 30, 2012
Data Sourced
04:15 PM
DescriptionSeverityAffected Software
Aug 8, 2012
CVE Published
via MITRE·10:00 AM
Data Sourced
via MITRE·10:00 AM
Description
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2012-3440?

CVE-2012-3440 has been classified as having a moderate severity level.

2

How do I fix CVE-2012-3440?

To fix CVE-2012-3440, update the sudo package to a version that does not contain the vulnerability.

3

Who is affected by CVE-2012-3440?

CVE-2012-3440 affects users of Red Hat Enterprise Linux 5 running sudo version 1.7.2.

4

What type of attack is associated with CVE-2012-3440?

CVE-2012-3440 is associated with a symlink attack that allows local users to overwrite files.

5

What is the impact of CVE-2012-3440?

The impact of CVE-2012-3440 is the potential for local users to manipulate system files and achieve unauthorized access.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203