CVE-2026-44312: CSS Parser Improper Certificate Validation Vulnerability

MODERATE
Advisory Identifier: GHSA-ff6c-w6qf-7xqc
CVSS 5.8
CWE-829 CWE-295
Published
Advisory Summary

CVE-2026-44312 is a MODERATE (CVSS 5.8) improper certificate validation vulnerability (CWE-829: Inclusion of Functionality from Untrusted Control Sphere) affecting CSS Parser libraries in the RubyGems ecosystem. The issue involves improper certificate validation allows mitm injection of remote css content. Remediation is available by upgrading affected packages to version 2.1.0, 1.22.0.

CVE-2026-44312 at a Glance

CVE Identifier CVE-2026-44312
GHSA Identifier GHSA-ff6c-w6qf-7xqc
Severity MODERATE
CVSS v3.1 Base Score 5.8
CWE Classification CWE-829: Inclusion of Functionality from Untrusted Control Sphere
Affected Product CSS Parser
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-44312

To remediate this vulnerability, upgrade all affected CSS Parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

css_parser fixed: 2.1.0
Upgrade css_parser to 2.1.0
css_parser fixed: 1.22.0
Upgrade css_parser to 1.22.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for css_parser

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-44312, inspect your project dependencies for CSS Parser:

inspect dependencies for css_parser

Analyze the terminal output to locate any version of CSS Parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.1.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere, where the product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere. In CSS Parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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.

CVE-2026-44312 Affected CSS Parser Versions

2 component(s)
Fixed Versions:
2.1.01.22.0
Product / Package Ecosystem Affected Versions Fixed Version
css_parser
RubyGems
≥ 2.0.0
< 2.1.0
2.1.0
css_parser
RubyGems
< 1.22.0
1.22.0

References

Frequently Asked Questions

What is CVE-2026-44312?
CVE-2026-44312 is a security vulnerability in CSS Parser involving Improper Certificate Validation allows MITM injection of remote CSS content under CWE-829: Inclusion of Functionality from Untrusted Control Sphere.
Which CSS Parser versions are affected?
Affected versions include releases prior to 2.1.0, 1.22.0 across affected packages: css_parser.
What version fixes CVE-2026-44312?
Upgrading to 2.1.0, 1.22.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is css_parser affected?
Yes, css_parser is affected in releases prior to 2.1.0, 1.22.0. Upgrade your dependency to 2.1.0, 1.22.0 or later.
What is the CVSS score of CVE-2026-44312?
CVE-2026-44312 has a CVSS v3.1 base score of 5.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2026-44312?
CVE-2026-44312 is classified under CWE-829: Inclusion of Functionality from Untrusted Control Sphere (The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.).
How can I check RubyGems dependencies for CVE-2026-44312?
Run the dependency tree command: 'inspect dependencies for css_parser'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-ff6c-w6qf-7xqc",
  "modified" : "2026-06-08T23:18:03Z",
  "published" : "2026-05-07T02:06:49Z",
  "aliases" : [ "CVE-2026-44312" ],
  "summary" : "CSS Parser: Improper Certificate Validation allows MITM injection of remote CSS content",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "css_parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.1.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "css_parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.22.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/premailer/css_parser/security/advisories/GHSA-ff6c-w6qf-7xqc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44312"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/premailer/css_parser/issues/185"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/premailer/css_parser/commit/35e689c904225add78e0c488cf04bad052666449"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/premailer/css_parser/commit/e0c95d5abe91b237becb90ff316531a6547ada18"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/premailer/css_parser"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/css_parser/CVE-2026-44312.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-295", "CWE-829" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T02:06:49Z",
    "nvd_published_at" : "2026-05-14T17:16:22Z"
  }
}