{"id":"CVE-2026-59728","aliases":["CVE-2026-59728","GHSA-8j5q-mfj2-5q9q"],"related":[],"kind":"vulnerability","state":"published","title":"@astrojs/rss: XML Injection via Unescaped RSS Feed Fields","summary":"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 </source> can close an element early and inject additional nodes (as with source.title). This corrupts feed structure, injects false metadata (for example, a fake <link> 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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 </source> can close an element early and inject additional nodes (as with source.title). This corrupts feed structure, injects false metadata (for example, a fake <link> 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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nIn `@astrojs/rss`, the `source.title` and `enclosure.type` item fields are interpolated directly into XML template strings without XML-character escaping before being parsed by `fast-xml-parser`. An attacker who controls these field values can inject arbitrary XML elements into the generated RSS feed.\n\n## Details\n\nTwo fields in `packages/astro-rss/src/index.ts` are affected:\n\n### `source.title`\n\n```typescript\nitem.source = parser.parse(\n  `<source url=\"${result.source.url}\">${result.source.title}</source>`,\n).source;\n```\n\n`source.title` is validated only as `z.string()`, with no restriction on XML special characters. A value containing `</source>` followed by arbitrary XML is parsed as real XML elements, merging injected nodes into the RSS item.\n\n### `enclosure.type`\n\n```typescript\nitem.enclosure = parser.parse(\n  `<enclosure url=\"${enclosureURL}\" length=\"${result.enclosure.length}\" type=\"${result.enclosure.type}\"/>`,\n).enclosure;\n```\n\n`enclosure.type` is also `z.string()` and is interpolated into an XML attribute without escaping. A value containing `\"` followed by additional XML can break out of the attribute and inject extra elements.\n\n## Proof of Concept\n\n`source.title` injection:\n\n```javascript\nsource: {\n  url: 'https://legit.example.com',\n  title: '</source><item><title>INJECTED</title><link>https://evil.com</link></item><source>',\n}\n// Result: RSS feed contains an injected <item> element with an evil.com link\n```\n\n`enclosure.type` injection:\n\n```javascript\nenclosure: {\n  url: 'https://example.com/a.mp3',\n  length: 0,\n  type: 'audio/mpeg\" /><link>https://evil.example.com</link><enclosure fake=\"',\n}\n// Result: RSS feed contains an injected <link> element\n```\n\nBoth injections were confirmed with `fast-xml-parser`: the injected `\"link\": \"https://evil.com\"` appears in the parsed output.\n\n## Impact\n\nAn attacker who can control `source.title` or `enclosure.type` values (e.g., via a CMS, database, or user-submitted content that populates `RSSFeedItem`) can inject arbitrary XML into the generated RSS feed. This corrupts feed structure, injects false metadata (e.g., a fake `<link>` 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.\n\n## Patches\n\nFixed in `@astrojs/rss@4.0.19`.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Astro es un framework web para sitios web basados en contenido. En las versiones 1.0.0 a 4.0.18, los campos de elemento source.title y enclosure.type en packages/astro-rss/src/index.ts se interpolan directamente en cadenas de plantilla XML sin escape de caracteres XML antes de ser analizados por fast-xml-parser. Ambos campos se validan solo como z.string(), sin imponer ninguna restricción sobre los caracteres especiales XML. Un atacante que controla estos valores puede inyectar XML arbitrario en el feed RSS generado: un valor que contenga ’”’ puede salir de un atributo (como con enclosure.type), y un valor que contenga [/source] puede cerrar un elemento prematuramente e inyectar nodos adicionales (como con source.title). Esto corrompe la estructura del feed, inyecta metadatos falsos (por ejemplo, un [link] falso que apunta a una URL maliciosa), y puede hacer que los lectores de feeds analicen incorrectamente o muestren contenido controlado por el atacante. En modo SSR (output: ’server’), el feed envenenado se sirve en cada solicitud a todos los suscriptores. Este problema ha sido solucionado en la versión 4.0.19.","source":"nvd"}],"published":"2026-07-20T23:21:47.000Z","modified":"2026-10-24T13:10:00.147Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N","score":4.3,"rating":"MEDIUM"}],"cwes":["CWE-91"],"affected":[{"ranges":[{"version":">= 1.0.0, < 4.0.19","status":"affected"}],"vendor":"withastro","product":"astro","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"1.0.0","status":"affected","fixed":"4.0.19"}],"ecosystem":"npm","package":"@astrojs/rss","purl":"pkg:npm/%40astrojs/rss","source":"ghsa"}],"references":[{"url":"https://github.com/withastro/astro/security/advisories/GHSA-8j5q-mfj2-5q9q","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/withastro/astro/pull/17209","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/withastro/astro/commit/fbcfa039dfe3d700b239f595a6c55ee35e45bd06","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/withastro/astro/releases/tag/@astrojs/rss@4.0.19","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59728","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/withastro/astro","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-07-28T14:27:36.621Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-59728","url":"https://www.cve.org/CVERecord?id=CVE-2026-59728","licence":"CVE Terms of Use","modified":"2026-07-28T14:27:56.334Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-8j5q-mfj2-5q9q","url":"https://github.com/advisories/GHSA-8j5q-mfj2-5q9q","licence":"CC-BY-4.0","modified":"2026-08-12T20:45:07.738Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-59728","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59728","licence":"Public domain","modified":"2026-10-24T13:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:30.266Z","epss":{"score":0.00322,"percentile":0.27266,"date":"2026-12-01T12:00:22.000Z"}}