Skip to content
Heist/ feed
Back to feed
UnratedFix available

XSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags

Type: advisorySources: OSV

The neutralization that ammonia applied to `animate` and `set` was not applied to other forms of SVG animation, which can be used for XSS. The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it. ```xml Click set ``` Ammonia did not apply attribute filters based on `attributeName`, so the contents of the `to`, `from`, and `values` tags were not sanitized as URLs. Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default. --- This vulnerability was reported by [ucsurf](https://uc.surf).

Products
ammonia
Affected versions
Not specified
Fixed versions
4.1.7, 4.2.3
CVEs
Not specified
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 09:01 UTC · Revision 1

Source evidence

XSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags

core-osv · Original source

Published 10 Oct 2021, 12:00 UTC

The neutralization that ammonia applied to `animate` and `set` was not applied to other forms of SVG animation, which can be used for XSS. The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it. ```xml Click set ``` Ammonia did not apply attribute filters based on `attributeName`, so the contents of the `to`, `from`, and `values` tags were not sanitized as URLs. Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default. --- This vulnerability was reported by [ucsurf](https://uc.surf).

osv:RUSTSEC-2021-0158

ammonia

Fixed versions: 4.1.7, 4.2.3

Complete source record
{
  "id": "fbca830f4c119ad1651bb4b272ed90c110d359ed7ea3d020d9f525c42ca9f00d",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2021-0158",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "XSS in ammonia via SVG `animateMotion`, `animateTransform`, and/or `animateColor` tags",
    "summary": "The neutralization that ammonia applied to `animate` and `set` was not applied to other forms of SVG animation, which can be used for XSS. The following SVG will produce a link with a javascript scheme. If the user clicks this link, they will run it. ```xml Click set ``` Ammonia did not apply attribute filters based on `attributeName`, so the contents of the `to`, `from`, and `values` tags were not sanitized as URLs. Applications that do not explicitly allow any of these tags should not be affected, since none are allowed by default. --- This vulnerability was reported by [ucsurf](https://uc.surf).",
    "evidence": "osv:RUSTSEC-2021-0158",
    "products": [
      {
        "name": {
          "value": "ammonia",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.1.7",
            "evidence": "/affected/0/ranges"
          },
          {
            "value": "4.2.3",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "RUSTSEC-2021-0158",
      "aliases": [
        "GHSA-f2pc-rwv3-69mv",
        "RUSTSEC-2021-0158"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "4.1.7"
                },
                {
                  "introduced": "4.2.0"
                },
                {
                  "fixed": "4.2.3"
                }
              ]
            }
          ],
          "package": {
            "name": "ammonia",
            "purl": "pkg:cargo/ammonia",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": null,
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2021-0158.json",
            "categories": [
              "format-injection"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": []
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-13T07:30:02.289306454Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/ammonia",
        "https://rustsec.org/advisories/RUSTSEC-2021-0158.html",
        "https://github.com/rust-ammonia/ammonia/pull/261"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 307452,
  "published_at": "2021-10-10T12:00:00+00:00"
}