XSS Vulnerability in AngularJS

angular Updated 02 Oct 2025

Summary

05/08/2020
MODERATE
Yes i
Moderate
5.0

GHSA-5cp4-xmrw-59wf: XSS via JQLite DOM manipulation functions in AngularJS. Affects angular versions < 1.8.0. Fixed in 1.8.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

AngularJS is an open-source JavaScript framework used for building dynamic web applications. It provides a set of tools and functionalities for creating single-page applications. The vulnerability in AngularJS allows for cross-site scripting (XSS) attacks when user-controlled HTML snippets are sanitized and passed to certain JQLite DOM manipulation functions.

Vulnerability Detail

The XSS vulnerability in AngularJS arises from the way JQLite, a DOM manipulation library within AngularJS, modifies input HTML before inserting it into the DOM. When JQLite's jqLiteBuildFragment function is called with a user-controlled HTML string that has been sanitized, the transformation performed by JQLite can inadvertently convert an inert, sanitized payload into a payload containing JavaScript. This can lead to the execution of arbitrary code and potential XSS attacks when the payload is inserted into the DOM. The vulnerability is similar to a bug in jQuery's htmlPrefilter function, which was fixed in jQuery 3.5.0.

How To Fix

Minimum fixed version

1.8.0

This is the first release that contains the fix.

npm install angular@1.8.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

A possible workaround for this vulnerability is to change the configuration of the HTML sanitizer to disallow certain tag groupings or inline style elements that may be exploited. However, it is uncertain if all possible exploitation vectors would be covered by this workaround. Therefore, upgrading to AngularJS 1.8.0 is the recommended solution.

Conclusion

The XSS vulnerability in AngularJS can have serious security implications for web applications. It is crucial to upgrade to the patched version of AngularJS (1.8.0) and, if applicable, upgrade jQuery to version 3.5.0 or higher. Regularly monitoring for vulnerabilities using tools like Vulert can help ensure the security of your applications.

See every vulnerability recorded for angular →

Share this vulnerability

FAQ

AngularJS is an open-source JavaScript framework for building dynamic web applications. It provides a set of tools and functionalities for creating single-page applications.

JQLite is a DOM manipulation library that is part of AngularJS. It allows developers to interact with the DOM and perform various operations on HTML elements.

The XSS vulnerability in AngularJS can allow attackers to execute arbitrary code and perform cross-site scripting attacks. This can lead to unauthorized access, data theft, and other malicious activities.

To fix this vulnerability, you should upgrade to AngularJS 1.8.0 or higher. If you are using AngularJS with jQuery, it is also recommended to upgrade jQuery to version 3.5.0 or higher.

A possible workaround is to change the configuration of the HTML sanitizer to disallow certain tag groupings or inline style elements that may be exploited. However, this may not cover all possible exploitation vectors.

Related vulnerabilities

Recent vulnerabilities recorded for angular.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

1.8.0

This is the first release that contains the fix.

npm install angular@1.8.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback