5.8medium
css_parser allows to MITM included https css urls
- Severity
- 5.8medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.15% (higher than 4% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-ff6c-w6qf-7xqc
Description
css_parser is a Ruby CSS parser. Prior to 2.1.0 and 1.22.0, 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. This vulnerability is fixed in 2.1.0 and 1.22.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| premailer css_parser | >= 2.0.0, < 2.1.0, < 1.22.0 | CVE List |
| css_parser (RubyGems) | from 2.0.0 before 2.1.0, before 1.22.0 | GitHub Advisory Database |
All scores
| GitHub_M | 5.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N |
| GitHub | 5.8medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N |
Classification
What each source says
CVE List
css_parser is a Ruby CSS parser. Prior to 2.1.0 and 1.22.0, 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. This vulnerability is fixed in 2.1.0 and 1.22.0.
GitHub Advisory Database
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
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
- 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.
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.
NVD (es)
css_parser es un analizador CSS de Ruby. Antes de las versiones 2.1.0 y 1.22.0, la gema CSS Parser no valida las conexiones HTTPS, permitiendo a un atacante man-in-the-middle (MitM) inyectar o modificar contenido CSS cuando las hojas de estilo se cargan a través de HTTPS. La conexión se establece con OpenSSL::SSL::VERIFY_NONE, lo que significa que cualquier certificado HTTPS -incluso los completamente no confiables- será aceptado sin validación. Esta vulnerabilidad está corregida en las versiones 2.1.0 y 1.22.0.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44312 changed 2026-05-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-ff6c-w6qf-7xqc changed 2026-06-08 | CC-BY-4.0 |
| NVD | CVE-2026-44312 changed 2026-10-26 | Public domain |