Loading...
Skip to main content

CVE-2026-44312 — Vulnerability in css_parser — CVE Details

MEDIUM

CSS Parser: Improper Certificate Validation allows MITM injection of remote CSS content

Published May 7, 2026Updated June 8, 2026Source: osv

Summary

### Summary The CSS Parser gem does not validate HTTPS connections, allowing a Man-in-the-Middle (MITM) attacker to inject or modify CSS content when stylesheets are loaded via HTTPS. The connection is established with `OpenSSL::SSL::VERIFY_NONE`, meaning any HTTPS certificate—even entirely untrusted—will be accepted without validation. ### Details In `lib/css_parser/parser.rb`, the HTTP client sets: https://github.com/premailer/css_parser/blob/3f91e8db7547fac50ab50cb7f9920f785f722740/lib/css_parser/parser.rb#L646 ```ruby http.verify_mode = OpenSSL::SSL::VERIFY_NONE ``` As a result, the library does not validate the authenticity of HTTPS connections and does not protect against man-in-the-middle attacks. Any attacker in a position to intercept network traffic can inject or modify CSS loaded via HTTPS URLs without detection or warning. ### PoC 1. Set up a test Ruby project that uses the CSS Parser gem and loads an external stylesheet over HTTPS. 2. Use a local proxy (such as mitmproxy or Burp Suite) to intercept outgoing HTTPS requests. 3. Present a fake self-signed certificate to the client. 4. Inject custom CSS into the intercepted HTTPS response. The request will succeed and the injected CSS will be delivered to the application, as the connection is not validated. ### References https://github.com/premailer/css_parser/issues/185 ### Impact Applications using CSS Parser to load remote stylesheets over HTTPS are vulnerable to CSS injection and content manipulation, regardless of the trust status of the remote server. All users who use CSS Parser to fetch external CSS over HTTPS may be impacted. ### Credit This vulnerability was uncovered by @JLLeitschuh of the @braze-inc security team.

Advisory Timeline

  • First published May 7, 2026 (158 days ago).
  • Last revised June 8, 2026 — 33 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Bundler
Update css_parser to 1.22.0 or later
gem install css_parser -v 1.22.0
Bundler
Update css_parser to 2.1.0 or later
gem install css_parser -v 2.1.0

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

Affected Packages (2)

Affects 1 ecosystem: rubygems (1).

PackageEcosystemAffectedFixed In
css_parser
rubygems
0.9.0, 0.9.1, 1.0.0, 1.0.1 (+56 more)1.22.0
css_parser
rubygems
2.0.02.1.0

Vulnerability Classification

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

CVSS Score Breakdown

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

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

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

Frequently Asked Questions

What is CVE-2026-44312?
CSS Parser: Improper Certificate Validation allows MITM injection of remote CSS content This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 5.8/10).
How do I check if my project is affected by CVE-2026-44312?
CVE-2026-44312 affects css_parser. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-44312 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
5.8

Exploitation requires specific conditions or has limited impact. Remediate within weeks.

Also Known As

GHSA-ff6c-w6qf-7xqc

Related CVEs

Check if you're affected

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

Scan Your Dependencies