PT-2026-38404 · Rubygems · Css Parser
Published
2026-05-07
·
Updated
2026-05-07
·
CVE-2026-44312
CVSS v3.1
5.8
Medium
| Vector | AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N |
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#L646http.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
- Set up a test Ruby project that uses the CSS Parser gem and loads an external stylesheet over HTTPS.
- Use a local proxy (such as mitmproxy or Burp Suite) to intercept outgoing HTTPS requests.
- Present a fake self-signed certificate to the client.
- 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.
Resources
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.
Fix
Improper Certificate Validation
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Css Parser