{"id":"CVE-2026-44312","aliases":["CVE-2026-44312","GHSA-ff6c-w6qf-7xqc"],"related":[],"kind":"vulnerability","state":"published","title":"css_parser allows to MITM included https css urls","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe 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.\n\n### Details\n\nIn `lib/css_parser/parser.rb`, the HTTP client sets:\nhttps://github.com/premailer/css_parser/blob/3f91e8db7547fac50ab50cb7f9920f785f722740/lib/css_parser/parser.rb#L646\n\n```ruby\nhttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n```\n\nAs 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.\n\n### PoC\n\n1. Set up a test Ruby project that uses the CSS Parser gem and loads an external stylesheet over HTTPS.\n2. Use a local proxy (such as mitmproxy or Burp Suite) to intercept outgoing HTTPS requests.\n3. Present a fake self-signed certificate to the client.\n4. Inject custom CSS into the intercepted HTTPS response.\n   \nThe request will succeed and the injected CSS will be delivered to the application, as the connection is not validated.\n\n### References\n \nhttps://github.com/premailer/css_parser/issues/185\n\n### Impact\n\nApplications 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.\n\n### Credit\n\nThis vulnerability was uncovered by @JLLeitschuh of the @braze-inc security team.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-05-07T02:06:49.000Z","modified":"2026-10-26T14:10:00.130Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N","score":5.8,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N","score":5.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N","score":5.8,"rating":"MEDIUM"}],"cwes":["CWE-295","CWE-829"],"affected":[{"ranges":[{"version":">= 2.0.0, < 2.1.0","status":"affected"},{"version":"< 1.22.0","status":"affected"}],"vendor":"premailer","product":"css_parser","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.0.0","status":"affected","fixed":"2.1.0"}],"ecosystem":"RubyGems","package":"css_parser","purl":"pkg:gem/css_parser","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.22.0"}],"ecosystem":"RubyGems","package":"css_parser","purl":"pkg:gem/css_parser","source":"ghsa"}],"references":[{"url":"https://github.com/premailer/css_parser/security/advisories/GHSA-ff6c-w6qf-7xqc","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/premailer/css_parser/issues/185","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/premailer/css_parser/commit/35e689c904225add78e0c488cf04bad052666449","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/premailer/css_parser/commit/e0c95d5abe91b237becb90ff316531a6547ada18","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44312","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/premailer/css_parser","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/css_parser/CVE-2026-44312.yml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-05-15T18:05:24.647Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44312","url":"https://www.cve.org/CVERecord?id=CVE-2026-44312","licence":"CVE Terms of Use","modified":"2026-05-15T18:05:54.862Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-ff6c-w6qf-7xqc","url":"https://github.com/advisories/GHSA-ff6c-w6qf-7xqc","licence":"CC-BY-4.0","modified":"2026-06-08T23:30:16.074Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44312","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44312","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:21.729Z","epss":{"score":0.00146,"percentile":0.0403,"date":"2026-12-01T12:00:22.000Z"}}