Vulnerabilities in pkg:npm/reduce-css-calc

PACKAGE
Advisory Identifier: GHSA-4662-j96g-mv46
Advisory Summary

CVE-2016-10548 is a CRITICAL arbitrary code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Reduce css calc libraries in the npm ecosystem. The issue involves arbitrary code injection in reduce-css-calc. Remediation is available by upgrading affected packages to version 1.2.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/reduce-css-calc

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/reduce-css-calc. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-4662-j96g-mv46 CVE-2016-10548 CRITICAL Arbitrary Code Injection in reduce-css-calc

CVE-2016-10548 at a Glance

CVE Identifier CVE-2016-10548
GHSA Identifier GHSA-4662-j96g-mv46
Severity CRITICAL
CVSS v3.1 Base Score N/A
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Reduce css calc
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2016-10548

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

reduce-css-calc fixed: 1.2.5
npm install reduce-css-calc@1.2.5
Verify Direct and Transitive Dependencies

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

npm ls reduce-css-calc

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2016-10548, inspect your project dependencies using npm:

npm ls reduce-css-calc

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

Note: The npm ls reduce-css-calc 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Reduce css calc, 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

Affected versions of `reduce-css-calc` pass input directly to `eval`. If user input is passed into the calc function, this may result in cross-site scripting on the browser, or remote code execution on the server. ## Proof of Concept ``` const reduceCSSCalc = require('reduce-css-calc'); console.log(reduceCSSCalc(`calc( (Buffer(10000)))`)); console.log(reduceCSSCalc(`calc( (global['fs'] = require('fs')))`)); console.log(reduceCSSCalc(`calc( (fs['readFileSync']("/etc/passwd", "utf-8")))`)); ``` ## Recommendation Update to version 1.2.5 or later.

CVE-2016-10548 Affected Reduce css calc Versions

1 component(s)
Fixed Versions:
1.2.5
Product / Package Ecosystem Affected Versions Fixed Version
reduce-css-calc
npm
< 1.2.5
1.2.5

References

Frequently Asked Questions

What is CVE-2016-10548?
CVE-2016-10548 is a security vulnerability in Reduce css calc involving Arbitrary Code Injection in reduce-css-calc under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Reduce css calc versions are affected?
Affected versions include releases prior to 1.2.5 across affected packages: reduce-css-calc.
What version fixes CVE-2016-10548?
Upgrading to 1.2.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is reduce-css-calc affected?
Yes, reduce-css-calc is affected in releases prior to 1.2.5. Upgrade your dependency to 1.2.5 or later.
What CWE is associated with CVE-2016-10548?
CVE-2016-10548 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check npm dependencies for CVE-2016-10548?
Run the dependency tree command: 'npm ls reduce-css-calc'. 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-4662-j96g-mv46",
  "modified" : "2020-08-31T18:12:20Z",
  "published" : "2018-06-07T19:43:06Z",
  "aliases" : [ "CVE-2016-10548" ],
  "summary" : "Arbitrary Code Injection in reduce-css-calc",
  "details" : "Affected versions of `reduce-css-calc` pass input directly to `eval`. If user input is passed into the calc function, this may result in cross-site scripting on the browser, or remote code execution on the server.\n\n## Proof of Concept\n\n```\nconst reduceCSSCalc = require('reduce-css-calc');\nconsole.log(reduceCSSCalc(`calc(                       (Buffer(10000)))`));\nconsole.log(reduceCSSCalc(`calc(                       (global['fs'] = require('fs')))`));\nconsole.log(reduceCSSCalc(`calc(                       (fs['readFileSync'](\"/etc/passwd\", \"utf-8\")))`));\n```\n\n\n\n## Recommendation\n\nUpdate to version 1.2.5 or later.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "reduce-css-calc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2016-10548"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/ChALkeR/415a41b561ebea9b341efbb40b802fc9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-4662-j96g-mv46"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/144"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T20:57:38Z",
    "nvd_published_at" : null
  }
}