Skip to content

Commit 1892cbe

Browse files
postmodernRubySec CI
authored and
RubySec CI
committed
Updated advisory posts against rubysec/ruby-advisory-db@b6d7ca2
1 parent 21d4655 commit 1892cbe

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
layout: advisory
3+
title: 'CVE-2024-32463 (phlex): Cross-site Scripting (XSS) possible due to improper
4+
sanitisation of `href` attributes on `<a>` tags'
5+
comments: false
6+
categories:
7+
- phlex
8+
advisory:
9+
gem: phlex
10+
cve: 2024-32463
11+
ghsa: g7xq-xv8c-h98c
12+
url: https://github.com/phlex-ruby/phlex/security/advisories/GHSA-g7xq-xv8c-h98c
13+
title: Cross-site Scripting (XSS) possible due to improper sanitisation of `href`
14+
attributes on `<a>` tags
15+
date: 2024-04-16
16+
description: |
17+
### Summary
18+
19+
There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data.
20+
21+
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:`.
22+
23+
### Impact
24+
25+
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.
26+
27+
```ruby
28+
a(href: user_profile) { "Profile" }
29+
```
30+
31+
### Mitigation
32+
33+
The best way to mitigate this vulnerability is to update to one of the following versions:
34+
35+
- [1.10.1](https://rubygems.org/gems/phlex/versions/1.10.1)
36+
- [1.9.2](https://rubygems.org/gems/phlex/versions/1.9.2)
37+
- [1.8.3](https://rubygems.org/gems/phlex/versions/1.8.3)
38+
- [1.7.2](https://rubygems.org/gems/phlex/versions/1.7.2)
39+
- [1.6.3](https://rubygems.org/gems/phlex/versions/1.6.3)
40+
- [1.5.3](https://rubygems.org/gems/phlex/versions/1.5.3)
41+
- [1.4.2](https://rubygems.org/gems/phlex/versions/1.4.2)
42+
43+
### Workarounds
44+
45+
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.
46+
cvss_v3: 7.1
47+
patched_versions:
48+
- "~> 1.4.2"
49+
- "~> 1.5.3"
50+
- "~> 1.6.3"
51+
- "~> 1.7.2"
52+
- "~> 1.8.3"
53+
- "~> 1.9.2"
54+
- ">= 1.10.1"
55+
related:
56+
url:
57+
- https://nvd.nist.gov/vuln/detail/CVE-2024-28199
58+
- https://github.com/phlex-ruby/phlex/security/advisories/GHSA-g7xq-xv8c-h98c
59+
- https://github.com/phlex-ruby/phlex/commit/9e3f5b980655817993682e409cbda72956d865cb
60+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
61+
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy#unsafe-inline
62+
- https://github.com/advisories/GHSA-g7xq-xv8c-h98c
63+
---

0 commit comments

Comments
 (0)