CVE-2024-32463
JSON

7.1high

phlex makes Cross-site Scripting (XSS) possible due to improper sanitisation of `href` attributes on `<a>` tags

Severity
7.1high CVSS:3.1 by GitHub_M
Exploit likelihood
0.81% (higher than 54% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-g7xq-xv8c-h98c

Description

phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. The 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:`. This vulnerability is fixed in 1.10.1, 1.9.2, 1.8.3, 1.7.2, 1.6.3, 1.5.3, and 1.4.2. Configuring a Content Security Policy that does not allow `unsafe-inline` would effectively prevent this vulnerability from being exploited.

Affected

Product or packageVersionsReported by
phlex-ruby phlex>= 1.10.0, < 1.10.1, >= 1.9.0, < 1.9.2, >= 1.8.0, < 1.8.3, >= 1.7.0, < 1.7.2, >= 1.6.0, < 1.6.3, >= 1.5.0, < 1.5.3, >= 1.4.0, < 1.4.2CVE List
ruby fileutils1.0.0CVE List
phlex (RubyGems)from 1.10.0 before 1.10.1, from 1.9.0 before 1.9.2, from 1.8.0 before 1.8.3, from 1.7.0 before 1.7.2, from 1.6.0 before 1.6.3, from 1.5.0 before 1.5.3, before 1.4.2GitHub Advisory Database

All scores

GitHub_M7.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N
GitHub7.1high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N

Classification

CWE-79CWE-87

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

phlex is an open source framework for building object-oriented views in Ruby. There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data. The 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:`. This vulnerability is fixed in 1.10.1, 1.9.2, 1.8.3, 1.7.2, 1.6.3, 1.5.3, and 1.4.2. Configuring a Content Security Policy that does not allow `unsafe-inline` would effectively prevent this vulnerability from being exploited.

GitHub Advisory Database
Summary

There is a potential cross-site scripting (XSS) vulnerability that can be exploited via maliciously crafted user data.

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:.

Impact

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.

a(href: user_profile) { "Profile" }
Mitigation

The best way to mitigate this vulnerability is to update to one of the following versions:

Workarounds

Configuring a Content Security Policy that does not allow unsafe-inline would effectively prevent this vulnerability from being exploited.

NVD (es)

Phlex es un framework de código abierto para crear vistas orientadas a objetos en Ruby. Existe una posible vulnerabilidad de cross-site scripting (XSS) que puede explotarse mediante datos de usuario creados con fines malintencionados. El filtro para detectar y evitar el uso del esquema de URL `javascript:` en el atributo `href` de una etiqueta `<a rel="nofollow">` podría omitirse con tabulaciones `\t` o caracteres de nueva línea `\n` entre los caracteres de el protocolo, por ejemplo `java\tscript:`. Esta vulnerabilidad se solucionó en 1.10.1, 1.9.2, 1.8.3, 1.7.2, 1.6.3, 1.5.3 y 1.4.2. Configurar una política de seguridad de contenido que no permita "inseguro en línea" evitaría efectivamente que se aproveche esta vulnerabilidad.</a>

References

Sources

SourceRecordLicence
CVE ListCVE-2024-32463 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-g7xq-xv8c-h98c changed 2026-09-10CC-BY-4.0
NVDCVE-2024-32463 changed 2026-06-17Public domain