# CVE-2026-21618: hexpm hexpm Cross-Site Scripting in OAuth Authorization View

Source: https://junglewise.ai/threats/cve-2026-21618-hexpm-hexpm-cross-site-scripting-in-oauth-authorization-view  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-01-19. Updated: 2026-07-24  
License: CC BY 4.0 with a link back

CVE-2026-21618 · Severity: medium · CVSS 6.1 · Published 2026-01-19

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.

Technologies: [Hex (Hex)](https://junglewise.ai/threats/technologies/hex). Vendors: [Hex](https://junglewise.ai/threats/vendors/hex).

## Quick answers

**Is CVE-2026-21618 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-21618 being exploited in the wild.

**How severe is CVE-2026-21618?** Medium severity, with a CVSS score of 6.1, published 19 January 2026.

**Which products and versions are affected?** Hex (Hex) from 617e44c71f1dd9043870205f371d375c5c4d886d before c692438684ead90c3bcbfb9ccf4e63c768c668a8.

**Is there a fix for CVE-2026-21618?** A patch was published on 2026-01-19: Fix merged in commit c692438684ead90c3bcbfb9ccf4e63c768c668a8 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-21618 attacked?** It is attacked over the network, in a web application.

**Am I affected by CVE-2026-21618?** Check whether you run Hex (Hex) or hexpm (Hex) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## 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

## References

- [https://github.com/](https://github.com/)
- [https://cna.erlef.org/cves/CVE-2026-21618.html](https://cna.erlef.org/cves/CVE-2026-21618.html)
- [https://github.com/hexpm/hexpm/commit/c692438684ead90c3bcbfb9ccf4e63c768c668a8](https://github.com/hexpm/hexpm/commit/c692438684ead90c3bcbfb9ccf4e63c768c668a8)
- [https://github.com/hexpm/hexpm/security/advisories/GHSA-6cw9-5gg4-rhpj](https://github.com/hexpm/hexpm/security/advisories/GHSA-6cw9-5gg4-rhpj)

## Related threats

- [Insufficient Verification of Data Authenticity vulnerability in hexpm hex (Hex.RemoteConverger module) allows…](https://junglewise.ai/threats/cve-2026-32148-insufficient-verification-of-data-authenticity-vulnerability-in)
- [hexpm Denial of Service via Excessive Allocation in package extraction](https://junglewise.ai/threats/cve-2026-23940-hexpm-denial-of-service-via-excessive-allocation-in-package)
