CVE-2017-1002201: Haml Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-r53w-g4xm-3gc6
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2017-1002201 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Haml libraries in the RubyGems ecosystem. The issue involves haml vulnerable to cross-site scripting. Remediation is available by upgrading affected packages to version 5.0.0.

CVE-2017-1002201 at a Glance

CVE Identifier CVE-2017-1002201
GHSA Identifier GHSA-r53w-g4xm-3gc6
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Haml
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2017-1002201

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

haml fixed: 5.0.0
Upgrade haml to 5.0.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 haml

How to Check if You Are Affected

To determine whether your application is affected by CVE-2017-1002201, inspect your project dependencies for Haml:

inspect dependencies for haml

Analyze the terminal output to locate any version of Haml in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.0.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-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Haml, 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

In haml versions prior to version 5.0.0.beta.2, when using user input to perform tasks on the server, characters like `< > " '` must be escaped properly. In this case, the `'` character was missed. An attacker can manipulate the input to introduce additional attributes, potentially executing code.

CVE-2017-1002201 Affected Haml Versions

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

References

Frequently Asked Questions

What is CVE-2017-1002201?
CVE-2017-1002201 is a security vulnerability in Haml involving Haml vulnerable to cross-site scripting under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Haml versions are affected?
Affected versions include releases prior to 5.0.0 across affected packages: haml.
What version fixes CVE-2017-1002201?
Upgrading to 5.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is haml affected?
Yes, haml is affected in releases prior to 5.0.0. Upgrade your dependency to 5.0.0 or later.
What is the CVSS score of CVE-2017-1002201?
CVE-2017-1002201 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2017-1002201?
CVE-2017-1002201 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check RubyGems dependencies for CVE-2017-1002201?
Run the dependency tree command: 'inspect dependencies for haml'. 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-r53w-g4xm-3gc6",
  "modified" : "2023-08-25T21:32:06Z",
  "published" : "2019-10-21T21:59:13Z",
  "aliases" : [ "CVE-2017-1002201" ],
  "summary" : "Haml vulnerable to cross-site scripting",
  "details" : "In haml versions prior to version 5.0.0.beta.2, when using user input to perform tasks on the server, characters like `< > \" '` must be escaped properly. In this case, the `'` character was missed. An attacker can manipulate the input to introduce additional attributes, potentially executing code.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "haml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-1002201"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/haml/haml/commit/18576ae6e9bdcb4303fdbe6b3199869d289d67c2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/haml/haml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/haml/CVE-2017-1002201.yml"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2019/11/msg00007.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2021/12/msg00028.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.gentoo.org/glsa/202007-27"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-RUBY-HAML-20362"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-10-16T15:18:02Z",
    "nvd_published_at" : "2019-10-15T18:15:00Z"
  }
}