Vulnerabilities > CVE-2007-4727 - Improper Restriction of Operations Within the Bounds of A Memory Buffer vulnerability in Lighttpd
Attack vector
NETWORK Attack complexity
MEDIUM Privileges required
NONE Confidentiality impact
PARTIAL Integrity impact
PARTIAL Availability impact
PARTIAL Summary
Buffer overflow in the fcgi_env_add function in mod_proxy_backend_fastcgi.c in the mod_fastcgi extension in lighttpd before 1.4.18 allows remote attackers to overwrite arbitrary CGI variables and execute arbitrary code via an HTTP request with a long content length, as demonstrated by overwriting the SCRIPT_FILENAME variable, aka a "header overflow."
Vulnerable Configurations
Common Weakness Enumeration (CWE)
Common Attack Pattern Enumeration and Classification (CAPEC)
- Buffer Overflow via Environment Variables This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
- Overflow Buffers Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
- Client-side Injection-induced Buffer Overflow This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
- Filter Failure through Buffer Overflow In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
- MIME Conversion An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.
Nessus
NASL family Fedora Local Security Checks NASL id FEDORA_2007-2132.NASL description Lighttpd (1.4.17 and earlier) is prone to a header overflow when using the mod_fastcgi extension, this can lead to arbitrary code execution in the fastcgi application. This 1.4.18 update fixes the issue. Note that Tenable Network Security has extracted the preceding description block directly from the Fedora security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues. last seen 2020-06-01 modified 2020-06-02 plugin id 27752 published 2007-11-06 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/27752 title Fedora 7 : lighttpd-1.4.18-1.fc7 (2007-2132) NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-200710-02.NASL description The remote host is affected by the vulnerability described in GLSA-200710-02 (PHP: Multiple vulnerabilities) Several vulnerabilities were found in PHP. Mattias Bengtsson and Philip Olausson reported integer overflows in the gdImageCreate() and gdImageCreateTrueColor() functions of the GD library which can cause heap-based buffer overflows (CVE-2007-3996). Gerhard Wagner discovered an integer overflow in the chunk_split() function that can lead to a heap-based buffer overflow (CVE-2007-2872). Its incomplete fix caused incorrect buffer size calculation due to precision loss, also resulting in a possible heap-based buffer overflow (CVE-2007-4661 and CVE-2007-4660). A buffer overflow in the sqlite_decode_binary() of the SQLite extension found by Stefan Esser that was addressed in PHP 5.2.1 was not fixed correctly (CVE-2007-1887). Stefan Esser discovered an error in the zend_alter_ini_entry() function handling a memory_limit violation (CVE-2007-4659). Stefan Esser also discovered a flaw when handling interruptions with userspace error handlers that can be exploited to read arbitrary heap memory (CVE-2007-1883). Disclosure of sensitive memory can also be triggered due to insufficient boundary checks in the strspn() and strcspn() functions, an issue discovered by Mattias Bengtsson and Philip Olausson (CVE-2007-4657) Stefan Esser reported incorrect validation in the FILTER_VALIDATE_EMAIL filter of the Filter extension allowing arbitrary email header injection (CVE-2007-1900). NOTE: This CVE was referenced, but not fixed in GLSA 200705-19. Stanislav Malyshev found an error with unknown impact in the money_format() function when processing last seen 2020-06-01 modified 2020-06-02 plugin id 26942 published 2007-10-09 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/26942 title GLSA-200710-02 : PHP: Multiple vulnerabilities NASL family FreeBSD Local Security Checks NASL id FREEBSD_PKG_4B673AE75F9A11DC84DD000102CC8983.NASL description lighttpd maintainer reports : Lighttpd is prone to a header overflow when using the mod_fastcgi extension, this can lead to arbitrary code execution in the fastcgi application. For a detailed description of the bug see the external reference. This bug was found by Mattias Bengtsson and Philip Olausson last seen 2020-06-01 modified 2020-06-02 plugin id 26037 published 2007-09-14 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/26037 title FreeBSD : lighttpd -- FastCGI header overrun in mod_fastcgi (4b673ae7-5f9a-11dc-84dd-000102cc8983) NASL family Gentoo Local Security Checks NASL id GENTOO_GLSA-200709-16.NASL description The remote host is affected by the vulnerability described in GLSA-200709-16 (Lighttpd: Buffer overflow) Mattias Bengtsson and Philip Olausson have discovered a buffer overflow vulnerability in the function fcgi_env_add() in the file mod_fastcgi.c when processing overly long HTTP headers. Impact : A remote attacker could send a specially crafted request to the vulnerable Lighttpd server, resulting in the remote execution of arbitrary code with privileges of the user running the web server. Note that mod_fastcgi is disabled in Gentoo last seen 2020-06-01 modified 2020-06-02 plugin id 26214 published 2007-10-03 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/26214 title GLSA-200709-16 : Lighttpd: Buffer overflow NASL family Debian Local Security Checks NASL id DEBIAN_DSA-1362.NASL description Several vulnerabilities were discovered in lighttpd, a fast webserver with minimal memory footprint, which could allow the execution of arbitrary code via the overflow of CGI variables when mod_fcgi was enabled. The Common Vulnerabilities and Exposures project identifies the following problems : - CVE-2007-3946 The use of mod_auth could leave to a denial of service attack crashing the webserver. - CVE-2007-3947 The improper handling of repeated HTTP headers could cause a denial of service attack crashing the webserver. - CVE-2007-3949 A bug in mod_access potentially allows remote users to bypass access restrictions via trailing slash characters. - CVE-2007-3950 On 32-bit platforms users may be able to create denial of service attacks, crashing the webserver, via mod_webdav, mod_fastcgi, or mod_scgi. last seen 2020-06-01 modified 2020-06-02 plugin id 25962 published 2007-09-03 reporter This script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof. source https://www.tenable.com/plugins/nessus/25962 title Debian DSA-1362-2 : lighttpd - several vulnerabilities NASL family SuSE Local Security Checks NASL id SUSE_LIGHTTPD-4532.NASL description This update fixes a buffer overflow in the fcgi_env_add() function. Under some circumstances this bug allows remote code execution. (CVE-2007-4727) last seen 2020-06-01 modified 2020-06-02 plugin id 27341 published 2007-10-17 reporter This script is Copyright (C) 2007-2019 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/27341 title openSUSE 10 Security Update : lighttpd (lighttpd-4532) NASL family Web Servers NASL id LIGHTTPD_FASTCGI_OVERFLOW.NASL description The remote web server appears to be lighttpd running with the FastCGI module (mod_fastcgi). The version of the FastCGI module on the remote host is affected by a buffer overflow vulnerability. A remote attacker can exploit this, by sending a specially crafted request with a long header, to add or replace headers passed to PHP, such as SCRIPT_FILENAME, which in turn could result in arbitrary code execution. last seen 2020-06-01 modified 2020-06-02 plugin id 26057 published 2007-09-17 reporter This script is Copyright (C) 2007-2018 Tenable Network Security, Inc. source https://www.tenable.com/plugins/nessus/26057 title lighttpd mod_fastcgi HTTP Request Header Remote Overflow
References
- http://fedoranews.org/updates/FEDORA-2007-213.shtml
- http://secunia.com/advisories/26732
- http://secunia.com/advisories/26794
- http://secunia.com/advisories/26824
- http://secunia.com/advisories/26997
- http://secunia.com/advisories/27229
- http://securityreason.com/securityalert/3127
- http://secweb.se/en/advisories/lighttpd-fastcgi-remote-vulnerability/
- http://trac.lighttpd.net/trac/changeset/1986
- http://www.gentoo.org/security/en/glsa/glsa-200709-16.xml
- http://www.lighttpd.net/assets/2007/9/9/lighttpd_sa_2007_12.txt
- http://www.novell.com/linux/security/advisories/2007_20_sr.html
- http://www.securityfocus.com/archive/1/479763/100/0/threaded
- http://www.securityfocus.com/bid/25622
- http://www.vupen.com/english/advisories/2007/3110
- https://bugzilla.redhat.com/show_bug.cgi?id=284511
- https://exchange.xforce.ibmcloud.com/vulnerabilities/36526
- https://issues.rpath.com/browse/RPL-1715