Arbitrary Code Execution

Affecting org.webjars.bower:angular artifact, versions (,1.5.0-beta.2)

Do your applications use this vulnerable package? Test your applications

Overview

org.webjars.bower:angular is a bower WebJar for angular.

Affected versions of this package are vulnerable to Arbitrary Code Execution via unsafe svg animation tags.

Details

Exploit Example:

<svg>
  <a xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="?">
    <circle r="400"></circle>
    <animate attributeName="xlink:href" begin="0" from="javascript:alert(1)" to="&" />
  </a>
</svg>

Here the anchor's href is animated, starting from a value that's a javascript URI. This allows execution of arbitrary javascript in the process. Preventing only the animation of links is tricky, as SVG is weird and namespaces aren't predictable. The fix is to have the sanitizer filter out svg animation tags instead.

Remediation

Upgrade org.webjars.bower:angular to version 1.5.0-beta.2 or higher.

References

CVSS Score

7.4
high severity
  • Attack Vector
    Network
  • Attack Complexity
    High
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    High
  • Availability
    None
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
Credit
Rodric Haddad
CWE
CWE-78
Snyk ID
SNYK-JAVA-ORGWEBJARSBOWER-479392
Disclosed
09 Mar, 2015
Published
23 Jan, 2017