CVE-2009-4492: Webrick WEBrick Improper Input Validation Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-6mq2-37j5-w6r6
CWE-20
Published
Advisory Summary

CVE-2009-4492 is a MODERATE webrick improper input validation vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Webrick libraries in the RubyGems ecosystem. The issue involves webrick improper input validation vulnerability. Remediation is available by upgrading affected packages to version 1.4.0.

CVE-2009-4492 at a Glance

CVE Identifier CVE-2009-4492
GHSA Identifier GHSA-6mq2-37j5-w6r6
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Webrick
Package Ecosystem RubyGems
Published Date
Last Updated

How to Fix CVE-2009-4492

To remediate this vulnerability, upgrade all affected Webrick dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

webrick fixed: 1.4.0
Upgrade webrick to 1.4.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for webrick

How to Check if You Are Affected

To determine whether your application is affected by CVE-2009-4492, inspect your project dependencies for Webrick:

inspect dependencies for webrick

Analyze the terminal output to locate any version of Webrick in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Webrick, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

WEBrick 1.3.1 in Ruby 1.8.6 through patchlevel 383, 1.8.7 through patchlevel 248, 1.8.8dev, 1.9.1 through patchlevel 376, and 1.9.2dev 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.

CVE-2009-4492 Affected Webrick Versions

1 component(s)
Fixed Versions:
1.4.0
Product / Package Ecosystem Affected Versions Fixed Version
webrick
RubyGems
< 1.4.0
1.4.0

References

Frequently Asked Questions

What is CVE-2009-4492?
CVE-2009-4492 is a security vulnerability in Webrick involving WEBrick Improper Input Validation vulnerability under CWE-20: Improper Input Validation.
Which Webrick versions are affected?
Affected versions include releases prior to 1.4.0 across affected packages: webrick.
What version fixes CVE-2009-4492?
Upgrading to 1.4.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is webrick affected?
Yes, webrick is affected in releases prior to 1.4.0. Upgrade your dependency to 1.4.0 or later.
What CWE is associated with CVE-2009-4492?
CVE-2009-4492 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check RubyGems dependencies for CVE-2009-4492?
Run the dependency tree command: 'inspect dependencies for webrick'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6mq2-37j5-w6r6",
  "modified" : "2025-05-22T16:55:39Z",
  "published" : "2017-10-24T18:33:38Z",
  "aliases" : [ "CVE-2009-4492" ],
  "summary" : "WEBrick Improper Input Validation vulnerability",
  "details" : "WEBrick 1.3.1 in Ruby 1.8.6 through patchlevel 383, 1.8.7 through patchlevel 248, 1.8.8dev, 1.9.1 through patchlevel 376, and 1.9.2dev 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.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "webrick"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.4.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.3.1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2009-4492"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-6mq2-37j5-w6r6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/webrick"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/webrick/CVE-2009-4492.yml"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20100113155532/http://www.vupen.com/english/advisories/2010/0089"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20100815010948/http://secunia.com/advisories/37949"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20170402100552/http://securitytracker.com/id?1023429"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20170908140655/http://www.securityfocus.com/archive/1/508830/100/0/threaded"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200228145937/http://www.securityfocus.com/bid/37710"
  }, {
    "type" : "WEB",
    "url" : "http://www.redhat.com/support/errata/RHSA-2011-0908.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.redhat.com/support/errata/RHSA-2011-0909.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.ruby-lang.org/en/news/2010/01/10/webrick-escape-sequence-injection"
  }, {
    "type" : "WEB",
    "url" : "http://www.ush.it/team/ush/hack_httpd_escape/adv.txt"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:19:44Z",
    "nvd_published_at" : "2010-01-13T20:30:00Z"
  }
}