CVE-2007-6595

LOW2.1/ 10.0
Share:
Published: December 31, 2007 at 07:46 PM
Modified: April 9, 2025 at 12:30 AM
Source: cve@mitre.org

Vulnerability Description

ClamAV 0.92 allows local users to overwrite arbitrary files via a symlink attack on (1) temporary files used by the cli_gentempfd function in libclamav/others.c or on (2) .ascii files used by sigtool, when utf16-decode is enabled.

CVSS Metrics

Base Score
2.1
Severity
LOW
Vector String
AV:L/AC:L/Au:N/C:N/I:P/A:N

Weaknesses (CWE)

Source: nvd@nist.gov

AI Security Analysis

01 // Technical Summary

ClamAV 0.92 is vulnerable to a symlink attack, allowing local users to overwrite arbitrary files. This can lead to system compromise by manipulating temporary files or files used during signature processing, potentially enabling privilege escalation or denial of service.

02 // Vulnerability Mechanism

Step 1: Target Selection: The attacker identifies a target file to overwrite (e.g., /etc/passwd).

Step 2: Symlink Creation: The attacker creates a symbolic link (symlink) with a predictable name, pointing to the target file. This symlink is usually created in a location where ClamAV will create a temporary file.

Step 3: Triggering ClamAV: The attacker triggers ClamAV to create a temporary file. This can be done by submitting a specially crafted file to be scanned or by using sigtool with UTF-16 decoding enabled.

Step 4: Race Condition: ClamAV creates a temporary file (or uses an .ascii file) without properly checking for the existence of a symlink with the same name. Due to the race condition, the attacker's symlink is in place before the file is created.

Step 5: File Overwrite: ClamAV writes data to the temporary file. Because of the symlink, this write operation actually overwrites the target file (e.g., /etc/passwd).

Step 6: System Compromise: The attacker uses the overwritten file (e.g., a modified /etc/passwd with a new user) to gain unauthorized access or escalate privileges.

03 // Deep Technical Analysis

The vulnerability stems from a race condition in how ClamAV handles temporary files and .ascii files when UTF-16 decoding is enabled. The cli_gentempfd function in libclamav/others.c and the sigtool utility create temporary files without properly checking for or preventing symlink attacks. An attacker can create a symlink pointing to a sensitive file (e.g., /etc/passwd, a configuration file, or a system binary). When ClamAV attempts to write to the temporary file, it actually writes to the target of the symlink, leading to arbitrary file overwrite. The flaw is exacerbated by the lack of proper input validation and insufficient checks for the existence and ownership of the target file before writing. This allows an attacker to control the contents of critical system files.

References & Intelligence

http://kolab.org/security/kolab-vendor-notice-19.txt
Source: cve@mitre.org
http://lists.opensuse.org/opensuse-security-announce/2008-04/msg00009.html
Source: cve@mitre.org
http://secunia.com/advisories/28949
Source: cve@mitre.org
Vendor Advisory
http://secunia.com/advisories/29891
Source: cve@mitre.org
http://secunia.com/advisories/31437
Source: cve@mitre.org
http://security.gentoo.org/glsa/glsa-200808-07.xml
Source: cve@mitre.org
http://securityreason.com/securityalert/3501
Source: cve@mitre.org
http://securitytracker.com/id?1019148
Source: cve@mitre.org
http://www.debian.org/security/2008/dsa-1497
Source: cve@mitre.org
http://www.mandriva.com/security/advisories?name=MDVSA-2008:088
Source: cve@mitre.org
http://www.securityfocus.com/archive/1/485631/100/0/threaded
Source: cve@mitre.org
http://www.securityfocus.com/bid/27064
Source: cve@mitre.org
http://www.vupen.com/english/advisories/2008/0606
Source: cve@mitre.org
https://exchange.xforce.ibmcloud.com/vulnerabilities/39335
Source: cve@mitre.org
https://exchange.xforce.ibmcloud.com/vulnerabilities/39339
Source: cve@mitre.org
http://kolab.org/security/kolab-vendor-notice-19.txt
Source: af854a3a-2127-422b-91ae-364da2661108
http://lists.opensuse.org/opensuse-security-announce/2008-04/msg00009.html
Source: af854a3a-2127-422b-91ae-364da2661108
http://secunia.com/advisories/28949
Source: af854a3a-2127-422b-91ae-364da2661108
Vendor Advisory
http://secunia.com/advisories/29891
Source: af854a3a-2127-422b-91ae-364da2661108
http://secunia.com/advisories/31437
Source: af854a3a-2127-422b-91ae-364da2661108
http://security.gentoo.org/glsa/glsa-200808-07.xml
Source: af854a3a-2127-422b-91ae-364da2661108
http://securityreason.com/securityalert/3501
Source: af854a3a-2127-422b-91ae-364da2661108
http://securitytracker.com/id?1019148
Source: af854a3a-2127-422b-91ae-364da2661108
http://www.debian.org/security/2008/dsa-1497
Source: af854a3a-2127-422b-91ae-364da2661108
http://www.mandriva.com/security/advisories?name=MDVSA-2008:088
Source: af854a3a-2127-422b-91ae-364da2661108
http://www.securityfocus.com/archive/1/485631/100/0/threaded
Source: af854a3a-2127-422b-91ae-364da2661108
http://www.securityfocus.com/bid/27064
Source: af854a3a-2127-422b-91ae-364da2661108
http://www.vupen.com/english/advisories/2008/0606
Source: af854a3a-2127-422b-91ae-364da2661108
https://exchange.xforce.ibmcloud.com/vulnerabilities/39335
Source: af854a3a-2127-422b-91ae-364da2661108
https://exchange.xforce.ibmcloud.com/vulnerabilities/39339
Source: af854a3a-2127-422b-91ae-364da2661108
CVE-2007-6595 - LOW Severity (2.1) | Free CVE Database | 4nuxd