GitHub Advisoryadvisory · npm

GHSA-6qqj-rx4w-r3cj CSRF Vulnerability in jquery-ujs

MEDIUM Published 2020-08-31 Modified 2021-09-23 Official page ↗
Ecosystem
npm
Packages
jquery-ujs
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Weaknesses
CWE-352
Reviewed
2020-08-31

Affected packages

• npm jquery-ujs: < 1.0.4 → fixed in 1.0.4

Description

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.

Related

Weakness · CWE (1)

  • CWE-352 Cross-Site Request Forgery weakness

References