Junglewise Threat Intelligence

CVE-2020-7676: Angular Cross-site Scripting in HTML sanitization

CVE-2020-7676 · Severity: low · CVSS 3.1 · Published 2020-06-18

Technologies: angular (npm). Vendors: npm, Google.

Executive brief

Angular's HTML sanitization feature, used to prevent malicious scripts in user-supplied content, contains a flaw that allows attackers to bypass the sanitization through regex manipulation. An attacker can craft malicious HTML containing option/select elements that, when processed, converts previously sanitized code into executable JavaScript, leading to session hijacking, credential theft, or malware distribution.

Technical details

The vulnerability is a Cross-site Scripting (XSS) flaw in Angular.js's regex-based HTML replacement mechanism used for input sanitization. The root cause is that wrapping <option> elements in <select> elements changes HTML parsing behavior, allowing previously sanitized code to become unsanitized. The vulnerability affects Angular versions prior to 1.8.0 and requires user interaction (application must process attacker-controlled HTML). An attacker with network access can inject malicious payloads into an application using the vulnerable Angular version; the application's inability to properly sanitize the crafted input allows script execution in the victim's browser. The fix was merged in version 1.8.0 (commit 2df43c07779137d1bddf7f3b282a1287a8634acd) and made available on May 27, 2020.

Affected products

  • Google Angular.js prior to 1.8.0

Timeline

  • 2020-06-08: disclosed: Published on NVD
  • 2020-05-27: patched: Fix merged as PR #17028 into Angular.js master branch; released in version 1.8.0
  • 2020-06-18: advisory: GHSA-mhp6-pxh8-r675 published

References

Related threats