CVE-2022-31103: Lettersanitizer Improper Handling Of CSS At-rules Vulnerability
HIGHCVE-2022-31103 is a HIGH (CVSS 7.5) improper handling of css at-rules vulnerability (CWE-754: Improper Check for Unusual or Exceptional Conditions) affecting Lettersanitizer libraries in the npm ecosystem. The issue involves improper handling of css at-rules in lettersanitizer. Remediation is available by upgrading affected packages to version 1.0.2.
CVE-2022-31103 at a Glance
Security Impact
CVSS: 7.5
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:U/C:N/I:N/A:H).
How to Fix CVE-2022-31103
To remediate this vulnerability, upgrade all affected Lettersanitizer dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install lettersanitizer@1.0.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls lettersanitizer
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-31103, inspect your project dependencies using npm:
npm ls lettersanitizer
Analyze the terminal output to locate any version of Lettersanitizer in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.2), your application is affected.
Note: The npm ls lettersanitizer command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions, where the product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product. In Lettersanitizer, 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
CVE-2022-31103 Affected Lettersanitizer Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
lettersanitizer
|
npm |
< 1.0.2
|
1.0.2
|
References
Frequently Asked Questions
What is CVE-2022-31103?
Which Lettersanitizer versions are affected?
What version fixes CVE-2022-31103?
Is lettersanitizer affected?
What is the CVSS score of CVE-2022-31103?
What CWE is associated with CVE-2022-31103?
How can I check npm dependencies for CVE-2022-31103?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7r3r-gq8p-v9jj",
"modified" : "2022-07-07T17:15:28Z",
"published" : "2022-06-23T17:48:19Z",
"aliases" : [ "CVE-2022-31103" ],
"summary" : "Improper handling of CSS at-rules in lettersanitizer",
"details" : "### Impact\n\nAll versions of lettersanitizer below 1.0.2 are affected by a denial of service issue when processing a CSS at-rule `@keyframes`.\n\nThis package is depended on by [react-letter](https://github.com/mat-sz/react-letter), therefore everyone using react-letter is also at risk.\n\n### Patches\n\nThe problem has been patched in version 1.0.2.\n\n### Workarounds\n\nThere is no workaround besides upgrading.\n\n### References\n\nThe issue was originally reported in the react-letter repository: https://github.com/mat-sz/react-letter/issues/17\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [lettersanitizer](https://github.com/mat-sz/lettersanitizer/issues)\n* Email me at [contact@matsz.dev](mailto:contact@matsz.dev)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "lettersanitizer"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mat-sz/lettersanitizer/security/advisories/GHSA-7r3r-gq8p-v9jj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-31103"
}, {
"type" : "WEB",
"url" : "https://github.com/mat-sz/react-letter/issues/17"
}, {
"type" : "WEB",
"url" : "https://github.com/mat-sz/lettersanitizer/commit/96d3dfe2ef0465d47324ed4d13e91ba0816a173f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mat-sz/lettersanitizer"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-754" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-23T17:48:19Z",
"nvd_published_at" : "2022-06-27T23:15:00Z"
}
}