CVE-2001-1494

MEDIUM5.5/ 10.0
Share:
Published: December 31, 2001 at 05:00 AM
Modified: April 3, 2025 at 01:03 AM
Source: cve@mitre.org

Vulnerability Description

script command in the util-linux package before 2.11n allows local users to overwrite arbitrary files by setting a hardlink from the typescript log file to any file on the system, then having root execute the script command.

CVSS Metrics

Base Score
5.5
Severity
MEDIUM
Vector String
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N

Weaknesses (CWE)

Source: nvd@nist.gov

AI Security Analysis

01 // Technical Summary

Local privilege escalation is possible due to a vulnerability in the script command of the util-linux package. An attacker can leverage a hardlink and a race condition to overwrite arbitrary files on the system, potentially achieving root access and complete system compromise.

02 // Vulnerability Mechanism

Step 1: Hardlink Creation: The attacker creates a hardlink from the expected typescript log file path (typically in the current directory, e.g., typescript) to a target sensitive file (e.g., /etc/shadow).

Step 2: Privilege Escalation Trigger: The attacker convinces a privileged user (e.g., root) to execute the script command, typically by providing a crafted command or script to be executed within the script session.

Step 3: File Overwrite: The script command starts logging to the typescript file. Because of the hardlink, any data written to the typescript file is actually written to the target file (e.g., /etc/shadow).

Step 4: System Compromise: The attacker overwrites the target file with malicious content (e.g., a modified /etc/shadow file with a known password or a root shell).

03 // Deep Technical Analysis

The vulnerability stems from a race condition within the script command. The command creates a typescript log file to record terminal sessions. An attacker can create a hardlink from this log file to a sensitive system file (e.g., /etc/shadow). When the script command is executed by a privileged user (e.g., root), the command attempts to write to the log file. Due to the hardlink, this write operation actually overwrites the target file. The flaw lies in the lack of proper file locking or checks to prevent the hardlink from being created and exploited before the script command writes to the file. This allows an attacker to overwrite any file the user running script has write permissions to, which, in the case of a root user, is often the entire system.

References & Intelligence

http://seclists.org/bugtraq/2001/Dec/0122.html
Source: cve@mitre.org
Mailing ListThird Party Advisory
http://seclists.org/bugtraq/2001/Dec/0123.html
Source: cve@mitre.org
Mailing ListThird Party Advisory
http://secunia.com/advisories/16785
Source: cve@mitre.org
Broken Link
http://secunia.com/advisories/18502
Source: cve@mitre.org
Broken Link
http://support.avaya.com/elmodocs2/security/ASA-2006-014.htm
Source: cve@mitre.org
Third Party Advisory
http://www.redhat.com/support/errata/RHSA-2005-782.html
Source: cve@mitre.org
Broken LinkVendor Advisory
http://www.securityfocus.com/bid/16280
Source: cve@mitre.org
Broken LinkThird Party AdvisoryVDB Entry
https://exchange.xforce.ibmcloud.com/vulnerabilities/7718
Source: cve@mitre.org
Third Party AdvisoryVDB Entry
https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10723
Source: cve@mitre.org
Broken Link
http://seclists.org/bugtraq/2001/Dec/0122.html
Source: af854a3a-2127-422b-91ae-364da2661108
Mailing ListThird Party Advisory
http://seclists.org/bugtraq/2001/Dec/0123.html
Source: af854a3a-2127-422b-91ae-364da2661108
Mailing ListThird Party Advisory
http://secunia.com/advisories/16785
Source: af854a3a-2127-422b-91ae-364da2661108
Broken Link
http://secunia.com/advisories/18502
Source: af854a3a-2127-422b-91ae-364da2661108
Broken Link
http://support.avaya.com/elmodocs2/security/ASA-2006-014.htm
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party Advisory
http://www.redhat.com/support/errata/RHSA-2005-782.html
Source: af854a3a-2127-422b-91ae-364da2661108
Broken LinkVendor Advisory
http://www.securityfocus.com/bid/16280
Source: af854a3a-2127-422b-91ae-364da2661108
Broken LinkThird Party AdvisoryVDB Entry
https://exchange.xforce.ibmcloud.com/vulnerabilities/7718
Source: af854a3a-2127-422b-91ae-364da2661108
Third Party AdvisoryVDB Entry
https://oval.cisecurity.org/repository/search/definition/oval%3Aorg.mitre.oval%3Adef%3A10723
Source: af854a3a-2127-422b-91ae-364da2661108
Broken Link
CVE-2001-1494 - MEDIUM Severity (5.5) | Free CVE Database | 4nuxd