HTML injection (Improper Sanitization of Script-Related HTML Tags in a Web Page, Basic XSS) CWE-80
Open
Nobody has claimed this yet.
Type: Bug
- Dominant language
- TypeScript
- Stars
- 25.9k
- Forks
- 2.4k
- Avg merge
- 13h 10m
- Merged PRs (30d)
- 4
Description
Describe the bug
It is possible to insert html code and execute it
<style>body { background-color: blue }</style>
<iframe src="javascript:alert(0)"></iframe>
Expected behavior
Html chars escaped
Minimal reproducible OpenAPI snippet(if possible)
{
"openapi": "3.0.0",
"info": {
"title": "title",
"description": "description",
"version": "0.0.1"
},
"paths": {
"/path": {
"get": {
"operationId": "operationId",
"summary": "summary",
"description": "description <iframe src=\"javascript:alert(0)\"></iframe>",
"parameters": [
{
"name": "X-NAME",
"in": "header",
"description": "Some description <style>body { background-color: blue }</style>",
"required": true,
"schema": {
"maxLength": 255,
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success <iframe src=\"javascript:alert(0)\"></iframe>"
}
}
}
}
}
}
Screenshots

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by loading the supplied OpenAPI snippet in the Redoc UI and confirm how the description fields are rendered. Trace the rendering path for descriptions and verify that the style and javascript iframe payloads are displayed as text rather than executed; done means the reproduced XSS no longer runs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, javascript, openapi
- Domain
- documentation, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100