# CVE-2017-1002201: Haml vulnerable to cross-site scripting

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 6.1
- **CVSS:** 6.1 (v3.1, NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: Required; Scope: Changed (impact reaches other components); Confidentiality impact: Low; Integrity impact: Low; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.45% (percentile 74, 2026-11-26)
- **CWE:** CWE-79
- **Aliases:** GHSA-r53w-g4xm-3gc6, SNYK-RUBY-HAML-20362
- **Published:** 2019-10-15T17:35:57.000Z
- **Modified:** 2026-09-10T03:48:26.747Z

## Who should check

- Projects that depend on RubyGems package haml (\< 5.0.0)
- Anyone running http://haml.info/ haml All versions prior to version 5.0.0.beta.2

## Description

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.

## Affected and fixed versions

- RubyGems `haml`: affected \< 5.0.0; fixed 5.0.0 (osv)
- http://haml.info/ haml: All versions prior to version 5.0.0.beta.2 (cvelist)

## Mitigation

- Upgrade haml to 5.0.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2017-1002201. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2017-1002201.md
Affected: haml < 5.0.0
Fixed in: 5.0.0

Steps:
1. Search this machine and project for haml (RubyGems), http://haml.info/ haml: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2017-1002201 being exploited?

There is no confirmed exploitation: CVE-2017-1002201 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 1.45% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2017-1002201?

Medium: CVSS 6.1 (v3.1, scored by NVD). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.

### Which versions are affected by CVE-2017-1002201?

haml \< 5.0.0.

### Is there a fix for CVE-2017-1002201?

Yes. Fixed in 5.0.0. Upgrade haml to 5.0.0 or later.

### How do I check if I'm affected by CVE-2017-1002201?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://security.gentoo.org/glsa/202007-27>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2017-1002201>
- patch: <https://github.com/haml/haml/commit/18576ae6e9bdcb4303fdbe6b3199869d289d67c2>
- exploit: <https://snyk.io/vuln/SNYK-RUBY-HAML-20362>
- other: <https://lists.debian.org/debian-lts-announce/2019/11/msg00007.html>
- other: <https://lists.debian.org/debian-lts-announce/2021/12/msg00028.html>
- other: <https://github.com/haml/haml>
- other: <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/haml/CVE-2017-1002201.yml>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2017-1002201>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-r53w-g4xm-3gc6> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2017-1002201> · JSON: <https://flawdb.com/api/v1/entries/CVE-2017-1002201>
