Vulnerabilities in pkg:npm/jquery-ujs

PACKAGE
Advisory Summary

GHSA-6qqj-rx4w-r3cj is a MODERATE (CVSS 6.5) csrf vulnerability vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Jquery ujs libraries in the npm ecosystem. The issue involves csrf vulnerability in jquery-ujs. Remediation is available by upgrading affected packages to version 1.0.4.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/jquery-ujs

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-6qqj-rx4w-r3cj - MODERATE CSRF Vulnerability in jquery-ujs

GHSA-6qqj-rx4w-r3cj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-6qqj-rx4w-r3cj
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Jquery ujs
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.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:L/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 Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-6qqj-rx4w-r3cj

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

jquery-ujs fixed: 1.0.4
npm install jquery-ujs@1.0.4
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 jquery-ujs

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-6qqj-rx4w-r3cj, inspect your project dependencies using npm:

npm ls jquery-ujs

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

Note: The npm ls jquery-ujs 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-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Jquery ujs, 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

Versions 1.0.3 and earlier of jquery-ujs are vulnerable to an information leakage attack that may enable attackers to launch CSRF attacks, as it allows attackers to send CSRF tokens to external domains. When an attacker controls the href attribute of an anchor tag, or the action attribute of a form tag triggering a POST action, the attacker can set the href or action to " https://attacker.com". By prepending a space to the external domain, it causes jQuery to consider it a same origin request, resulting in the user's CSRF token being sent to the external domain. ## Recommendation Upgrade jquery-ujs to version 1.0.4 or later.

GHSA-6qqj-rx4w-r3cj Affected Jquery ujs Versions

1 component(s)
Fixed Versions:
1.0.4
Product / Package Ecosystem Affected Versions Fixed Version
jquery-ujs
npm
< 1.0.4
1.0.4

References

Frequently Asked Questions

What is GHSA-6qqj-rx4w-r3cj?
GHSA-6qqj-rx4w-r3cj is a security vulnerability in Jquery ujs involving CSRF Vulnerability in jquery-ujs under CWE-352: Cross-Site Request Forgery (CSRF).
Which Jquery ujs versions are affected?
Affected versions include releases prior to 1.0.4 across affected packages: jquery-ujs.
What version fixes GHSA-6qqj-rx4w-r3cj?
Upgrading to 1.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jquery-ujs affected?
Yes, jquery-ujs is affected in releases prior to 1.0.4. Upgrade your dependency to 1.0.4 or later.
What is the CVSS score of GHSA-6qqj-rx4w-r3cj?
GHSA-6qqj-rx4w-r3cj has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with GHSA-6qqj-rx4w-r3cj?
GHSA-6qqj-rx4w-r3cj is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check npm dependencies for GHSA-6qqj-rx4w-r3cj?
Run the dependency tree command: 'npm ls jquery-ujs'. 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-6qqj-rx4w-r3cj",
  "modified" : "2021-09-23T19:45:13Z",
  "published" : "2020-08-31T22:48:44Z",
  "aliases" : [ ],
  "summary" : "CSRF Vulnerability in jquery-ujs",
  "details" : "Versions 1.0.3 and earlier of jquery-ujs are vulnerable to an information leakage attack that may enable attackers to launch CSRF attacks, as it allows attackers to send CSRF tokens to external domains.\n\nWhen an attacker controls the href attribute of an anchor tag, or\nthe action attribute of a form tag triggering a POST action, the attacker can set the\nhref or action to \" https://attacker.com\". By prepending a space to the external domain, it causes jQuery to consider it a same origin request, resulting in the user's CSRF token being sent to the external domain.\n\n\n## Recommendation\n\nUpgrade jquery-ujs to version 1.0.4 or later.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jquery-ujs"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.0.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://hackerone.com/reports/49935"
  }, {
    "type" : "WEB",
    "url" : "https://groups.google.com/forum/#!msg/rubyonrails-security/XIZPbobuwaY/fqnzzpuOlA4J"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/npm:jquery-ujs:20150624"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/15"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-08-31T18:07:52Z",
    "nvd_published_at" : null
  }
}