Executive brief
A vulnerability exists in the Hex package manager's web interface, specifically within the OAuth and device authorization screens. This flaw could allow an attacker to execute malicious scripts in a user's browser if they are tricked into viewing a specially crafted page. Such an attack could lead to unauthorized actions being performed on behalf of the user or the theft of sensitive session information.
Technical details
A stored and reflected Cross-Site Scripting (XSS) vulnerability exists in the 'Elixir.HexpmWeb.SharedAuthorizationView' module of hexpm. The root cause is the use of raw() string interpolation instead of proper HTML escaping within the render_grouped_scopes/3 routine in lib/hexpm_web/views/shared_authorization_view.ex. An attacker can provide malicious JavaScript within OAuth scope names or descriptions which are then rendered without neutralization on the authorization screen. This requires a victim to interact with the authorization page. The issue has been patched by converting string interpolations to HEEx templates and implementing double-escaping for user-agent strings in Bootstrap popovers.
Affected products
- hexpm hexpm from 617e44c71f1dd9043870205f371d375c5c4d886d before c692438684ead90c3bcbfb9ccf4e63c768c668a8
- hexpm hex.pm from 2025-10-01 before 2026-01-19
Timeline
- 2026-01-19: advisory: Initial disclosure and NVD publication
- 2026-01-19: patched: Fix merged in commit c692438684ead90c3bcbfb9ccf4e63c768c668a8