Skip to content

Commit 0a22479

Browse files
--------- Co-authored-by: Postmodern <postmodern.mod3@gmail.com>
1 parent 9920c49 commit 0a22479

1 file changed

Lines changed: 50 additions & 0 deletions

File tree

gems/phlex/GHSA-g7xq-xv8c-h98c.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
gem: phlex
3+
ghsa: g7xq-xv8c-h98c
4+
url: https://github.com/phlex-ruby/phlex/security/advisories/GHSA-g7xq-xv8c-h98c
5+
title: Cross-site Scripting (XSS) possible due to improper sanitisation of `href` attributes on `<a>` tags
6+
date: 2024-04-16
7+
description: |
8+
### Summary
9+
There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data.
10+
11+
Our filter to detect and prevent the use of the `javascript:` URL scheme in the `href` attribute of an `<a>` tag could be bypassed with tab `\t` or newline `\n` characters between the characters of the protocol, e.g. `java\tscript:`.
12+
13+
### Impact
14+
15+
If you render an `<a>` tag with an `href` attribute set to a user-provided link, that link could potentially execute JavaScript when clicked by another user.
16+
17+
```ruby
18+
a(href: user_profile) { "Profile" }
19+
```
20+
21+
### Mitigation
22+
23+
The best way to mitigate this vulnerability is to update to one of the following versions:
24+
25+
- [1.10.1](https://rubygems.org/gems/phlex/versions/1.10.1)
26+
- [1.9.2](https://rubygems.org/gems/phlex/versions/1.9.2)
27+
- [1.8.3](https://rubygems.org/gems/phlex/versions/1.8.3)
28+
- [1.7.2](https://rubygems.org/gems/phlex/versions/1.7.2)
29+
- [1.6.3](https://rubygems.org/gems/phlex/versions/1.6.3)
30+
- [1.5.3](https://rubygems.org/gems/phlex/versions/1.5.3)
31+
- [1.4.2](https://rubygems.org/gems/phlex/versions/1.4.2)
32+
33+
### Workarounds
34+
Configuring a [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) that does not allow [`unsafe-inline`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline) would effectively prevent this vulnerability from being exploited.
35+
36+
cvss_v3: 7.1
37+
patched_versions:
38+
- "~> 1.4.2"
39+
- "~> 1.5.3"
40+
- "~> 1.6.3"
41+
- "~> 1.7.2"
42+
- "~> 1.8.3"
43+
- "~> 1.9.2"
44+
- ">= 1.10.1"
45+
related:
46+
url:
47+
- https://nvd.nist.gov/vuln/detail/CVE-2024-28199
48+
- https://github.com/phlex-ruby/phlex/commit/9e3f5b980655817993682e409cbda72956d865cb
49+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
50+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline

0 commit comments

Comments
 (0)