Skip to main content

Access of Resource Using Incompatible Type ('Type Confusion')

CVE-2021-32696

Severity Medium
Score 5.3/10

Summary

The npm package "striptags" is an implementation of PHP's strip_tags in Typescript. In striptags In striptags before version 3.2.0, and striptags-4.0.0-alpha.x, a type-confusion vulnerability can cause `striptags` to concatenate unsanitized strings when an array-like object is passed in as the `html` parameter. This can be abused by an attacker who can control the shape of their input, e.g. if query parameters are passed directly into the function. This can lead to a XSS.

  • LOW
  • NETWORK
  • LOW
  • UNCHANGED
  • NONE
  • NONE
  • NONE
  • NONE

CWE-843 - Access of Resource Using Incompatible Type ('Type Confusion')

The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.

Advisory Timeline

  • Published