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.
In lib/css_parser/parser.rb, the HTTP client sets:
https://github.com/premailer/cssparser/blob/3f91e8db7547fac50ab50cb7f9920f785f722740/lib/cssparser/parser.rb#L646
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.
The request will succeed and the injected CSS will be delivered to the application, as the connection is not validated.
https://github.com/premailer/css_parser/issues/185
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.
This vulnerability was uncovered by @JLLeitschuh of the @braze-inc security team.
{
"github_reviewed": true,
"severity": "MODERATE",
"github_reviewed_at": "2026-05-07T02:06:49Z",
"cwe_ids": [
"CWE-295",
"CWE-829"
],
"nvd_published_at": null
}