Loading...
Skip to main content

CVE-2024-32970 — Vulnerability in phlex — CVE Details

HIGH

Phlex vulnerable to Cross-site Scripting (XSS) via maliciously formed HTML attribute names and values

Published May 1, 2024Updated September 10, 2026Source: osv

Summary

There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. The reason these issues were not detected before is the escapes were working as designed. However, their design didn't take into account just how recklessly permissive browser are when it comes to executing unsafe JavaScript via HTML attributes. ### Impact 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. ```ruby a(href: user_profile) { "Profile" } ``` If you splat user-provided attributes when rendering any HTML or SVG tag, malicious event attributes could be included in the output, executing JavaScript when the events are triggered by another user. ```ruby h1(**JSON.parse(user_attributes)) ``` ### Patches Patches are [available on RubyGems](https://rubygems.org/gems/phlex) for all minor versions released in the last year. - [1.10.2](https://rubygems.org/gems/phlex/versions/1.10.2) - [1.9.3](https://rubygems.org/gems/phlex/versions/1.9.3) If you are on `main`, it has been patched since [`da8f943`](https://github.com/phlex-ruby/phlex/commit/da8f94342a84cff9d78c98bcc3b3604ee2e577d2) ### Workarounds Configuring a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) that does not allow [`unsafe-inline`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline) would effectively prevent this vulnerability from being exploited. ### References In addition to upgrading to a patched version of Phlex, we strongly recommend configuring a Content Security Policy header that does not allow `unsafe-inline`. Here’s how you can configure a Content Security Policy header in Rails. https://guides.rubyonrails.org/security.html#content-security-policy-header

Advisory Timeline

  • First published May 1, 2024 (894 days ago).
  • Last revised September 10, 2026 — 861 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update phlex to 1.9.3 or later
gem install phlex -v 1.9.3
Bundler
Update phlex to 1.10.2 or later
gem install phlex -v 1.10.2

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
phlex
rubygems
0.1.0, 0.2.0, 0.2.1, 0.2.2 (+42 more)1.9.3
phlex
rubygems
1.10.0, 1.10.11.10.2

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-79
    Cross-site Scripting (XSS)MITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.1 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N

Frequently Asked Questions

What is CVE-2024-32970?
Phlex vulnerable to Cross-site Scripting (XSS) via maliciously formed HTML attribute names and values This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.1/10).
How do I check if my project is affected by CVE-2024-32970?
CVE-2024-32970 affects phlex. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-32970 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.1

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-9p57-h987-4vgx

Related CVEs

  • CVE-2024-28199
    HIGH

    Cross-site Scripting (XSS) possible with maliciously formed HTML attribute names and values in Phlex

  • CVE-2026-94462
    HIGH

    Spree: Broken Access Control in `PATCH /api/v3/store/carts/:id/associate` (IDOR)

  • CVE-2024-32463
    HIGH

    Cross-site Scripting (XSS) possible due to improper sanitisation of `href` attributes on `<a>` tags

  • CVE-2026-77601
    HIGH

    OpenC3 COSMOS: Authenticated OS command injection via the `pypi_url` setting

  • GHSA-w67g-2h6v-vjgq
    HIGH

    Phlex XSS protection bypass via attribute splatting, dynamic tags, and href values

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies