# AngularJS XSS via JQLite DOM manipulation

Source: https://junglewise.ai/threats/angularjs-xss-via-jqlite-dom-manipulation-11995303  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2020-08-05. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2020-08-05

AngularJS is a popular JavaScript framework used to build dynamic web applications. A cross-site scripting (XSS) vulnerability in its DOM manipulation library (JQLite) allows attackers to inject malicious JavaScript code into web pages, even when HTML input has been sanitized by security libraries. An attacker can exploit this by crafting specially formatted HTML that bypasses sanitizers, potentially stealing user credentials, sessions, or performing actions on behalf of users.

Technologies: [angular (npm)](https://junglewise.ai/threats/technologies/angular). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 5 August 2020.

**Which products and versions are affected?** angular (npm) SEMVER:introduced=0,fixed=1.8.0.

**Is there a fix for This vulnerability?** Yes. angular (npm): upgrade to 1.8.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network.

**Am I affected?** Check whether you run angular (npm) 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.

## How to fix

- angular (npm): upgrade to 1.8.0 or later

  ```sh
  npm install angular@1.8.0
  ```


## Technical details

JQLite (AngularJS's built-in DOM manipulation library) uses regex-based HTML transformation in the jqLiteBuildFragment function to normalize XHTML self-closing tags before DOM insertion. When user-controlled HTML that has been sanitized by libraries like DOMPurify is passed to JQLite methods (append, prepend, after, replaceWith, or new JQLite), the tag expansion can inadvertently reactivate previously inert payloads. For example, a sanitizer may preserve `&lt;style/&gt;&lt;img src=x onerror="alert(1337)"/&gt;` as safe (the img is inert inside an unclosed style element), but JQLite's transformation converts `&lt;style/&gt;` to `&lt;style&gt;&lt;/style&gt;`, closing the style element and reactivating the img tag's onerror handler. This vulnerability requires the application to use JQLite methods with sanitized HTML; a network attack vector; and user interaction to view the malicious content. The issue is patched in AngularJS 1.8.0. Applications using jQuery instead of JQLite should upgrade jQuery to 3.5.0, which contains a similar fix.

## Affected products

- Google AngularJS <1.8.0

## Timeline

- 2020-08-05: disclosed: Advisory GHSA-5cp4-xmrw-59wf published
- 2020-08-05: patched: AngularJS 1.8.0 released with fix

## References

- [https://github.com/google/security-research/security/advisories/GHSA-5cp4-xmrw-59wf](https://github.com/google/security-research/security/advisories/GHSA-5cp4-xmrw-59wf)
- [https://github.com/jquery/jquery/security/advisories/GHSA-gxr4-xjj5-5px2](https://github.com/jquery/jquery/security/advisories/GHSA-gxr4-xjj5-5px2)
- [https://github.com/jquery/jquery/security/advisories/GHSA-jpcq-cgw6-v4j6](https://github.com/jquery/jquery/security/advisories/GHSA-jpcq-cgw6-v4j6)
- [https://blog.jquery.com/2020/04/10/jquery-3-5-0-released](https://blog.jquery.com/2020/04/10/jquery-3-5-0-released)
- [https://github.com/angular/angular.js](https://github.com/angular/angular.js)
- [https://snyk.io/vuln/SNYK-JS-ANGULAR-570058](https://snyk.io/vuln/SNYK-JS-ANGULAR-570058)

## Related threats

- [Google AngularJS XSS bypass in Strict Contextual Escaping](https://junglewise.ai/threats/cve-2026-11998-google-angularjs-xss-bypass-in-strict-contextual-escaping)
- [AngularJS improper SVG element sanitization bypass](https://junglewise.ai/threats/cve-2025-0716-angularjs-improper-svg-element-sanitization-bypass)
- [AngularJS image srcset attribute bypass in Content Security Policy](https://junglewise.ai/threats/cve-2024-8372-angularjs-image-srcset-attribute-bypass-in-content-security-policy)
- [AngularJS srcset attribute sanitization bypass](https://junglewise.ai/threats/cve-2024-8373-angularjs-srcset-attribute-sanitization-bypass)
- [AngularJS regular expression denial of service in ng-srcset](https://junglewise.ai/threats/cve-2024-21490-angularjs-regular-expression-denial-of-service-in-ng-srcset)
