Skip to main content
Vulnerability Database/CVE-2024-33665

CVE-2024-33665: Angular-Translate XSS Vulnerability

CVE-2024-33665 is a cross-site scripting flaw in angular-translate through version 2.19.1 that allows attackers to inject malicious scripts via crafted translation keys. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-33665 Overview

CVE-2024-33665 is a cross-site scripting (XSS) vulnerability [CWE-79] affecting the angular-translate library through version 2.19.1. The flaw allows attackers to inject arbitrary script content through a crafted translation key processed by the translate directive. When applications pass untrusted input as a translation key, the library renders the resulting content without sanitizing executable markup. The vendor states that the library documentation does not guarantee keys are safe against XSS attacks, placing responsibility on application developers to sanitize input before passing it to the directive.

Critical Impact

Attackers can execute arbitrary JavaScript in the context of a victim's browser session, enabling session theft, credential capture, or defacement of AngularJS applications that pass user-controlled values as translation keys.

Affected Products

  • angular-translate library, all versions through 2.19.1
  • AngularJS applications using the translate directive with untrusted key input
  • Legacy AngularJS 1.x front-end applications relying on angular-translate for internationalization

Discovery Timeline

  • 2024-04-26 - CVE-2024-33665 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-33665

Vulnerability Analysis

The vulnerability resides in how angular-translate processes keys passed to its translate directive and filter. When a key resolves to markup containing HTML or script content, the library inserts that content into the Document Object Model (DOM) in a way that permits execution. Applications that pass user-controlled values as keys expose themselves to script injection.

The maintainers have taken the position that keys were never contractually safe against XSS. See the GitHub Issue #1418 discussion and the follow-up maintainer comment for the project's stance. Technical details and a working demonstration are documented in the HeroDev XSS advisory and the StackBlitz proof-of-concept.

Root Cause

The root cause is missing output encoding for translation keys. The translate directive assumes keys are trusted developer-authored identifiers. When applications bind user input directly to the key parameter, the library renders attacker-controlled content without applying contextual escaping appropriate for HTML output.

Attack Vector

Exploitation requires user interaction, typically clicking a crafted link or visiting a page where attacker-controlled data flows into a translation key. An attacker builds a URL or form submission whose parameters propagate to a component using the translate directive. The library then renders the malicious payload, executing JavaScript in the victim's browser under the application's origin.

No verified exploit code is published beyond the StackBlitz demonstration linked in the external references. Describe the attack chain in prose rather than reproducing exploit code; the referenced advisory contains the technical demonstration.

Detection Methods for CVE-2024-33665

Indicators of Compromise

  • Unexpected <script> tags, event handlers, or encoded payloads appearing in HTTP request parameters that feed translation keys
  • Browser console errors or Content Security Policy (CSP) violations originating from pages that use the translate directive
  • Outbound requests from client sessions to attacker-controlled domains following rendering of translated content

Detection Strategies

  • Perform a dependency inventory to identify applications bundling angular-translate at version 2.19.1 or earlier
  • Static code review to locate translate directive, filter, or $translate service calls where keys are bound to user-controlled scope variables or URL parameters
  • Dynamic application security testing (DAST) with XSS payload fuzzing against inputs that reach translation keys

Monitoring Recommendations

  • Enable and log CSP violation reports to surface injected inline scripts in production AngularJS applications
  • Monitor web application firewall (WAF) logs for XSS payload patterns targeting routes that render localized content
  • Collect client-side telemetry for anomalous DOM modifications on pages that render translated strings

How to Mitigate CVE-2024-33665

Immediate Actions Required

  • Audit all translate directive, filter, and $translate service usages for keys sourced from user input, URL parameters, or external APIs
  • Apply strict input validation and output encoding to any value passed as a translation key
  • Deploy a restrictive Content Security Policy that disallows inline scripts and unsafe-eval to limit XSS impact

Patch Information

No upstream patch has been released. The maintainers consider the behavior documented, placing the responsibility on application developers to sanitize keys. Organizations requiring vendor-supported remediation can review the HeroDev advisory for mitigation guidance. Long-term, migrate off AngularJS and angular-translate, both of which are end-of-life.

Workarounds

  • Allowlist translation keys against a predefined set of static identifiers rather than accepting arbitrary strings
  • Escape or strip HTML from any dynamic key value before passing it to the translate directive
  • Use the translate filter only with trusted keys and move user-facing text through separately sanitized interpolation bindings
  • Plan migration to a maintained internationalization library and a supported front-end framework

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.