@astrojs/rss: XML Injection via Unescaped RSS Feed Fields
Description
Astro is a web framework for content-driven websites. In versions 1.0.0 through 4.0.18, the source.title and enclosure.type item fields in packages/astro-rss/src/index.ts are interpolated directly into XML template strings without XML-character escaping before being parsed by fast-xml-parser. Both fields are validated only as z.string(), placing no restriction on XML special characters. An attacker who controls these values can inject arbitrary XML into the generated RSS feed: a value containing " can break out of an attribute (as with enclosure.type), and a value containing can close an element early and inject additional nodes (as with source.title). This corrupts feed structure, injects false metadata (for example, a fake pointing to a malicious URL), and can cause feed readers to misparse or display attacker-controlled content. In SSR mode (output: 'server'), the poisoned feed is served on every request to all subscribers. This issue has been fixed in version 4.0.19.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
@astrojs/rssnpm | >= 1.0.0, < 4.0.19 | 4.0.19 |
Affected products
2- Range: 1.0.0 - 4.0.18
Patches
Vulnerability mechanics
References
5- github.com/advisories/GHSA-8j5q-mfj2-5q9qghsaADVISORY
- github.com/withastro/astro/commit/fbcfa039dfe3d700b239f595a6c55ee35e45bd06ghsax_refsource_MISCWEB
- github.com/withastro/astro/pull/17209ghsax_refsource_MISCWEB
- github.com/withastro/astro/releases/tag/@astrojs/[email protected]ghsax_refsource_MISCWEB
- github.com/withastro/astro/security/advisories/GHSA-8j5q-mfj2-5q9qghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.