Skip to content

Escape code examples in detect-html-injection.md#76

Open
lolgab wants to merge 1 commit intogkouziik:masterfrom
lolgab:patch-1
Open

Escape code examples in detect-html-injection.md#76
lolgab wants to merge 1 commit intogkouziik:masterfrom
lolgab:patch-1

Conversation

@lolgab
Copy link
Copy Markdown

@lolgab lolgab commented Sep 4, 2023

No description provided.

`document.writeln` | All | `document.writeln("<b>" + userControlledVal + "</b>");`
`anyElement.innerHTML` | All | `divElem.innerHTML = “Hello ” + userControlledVal`
`anyElement.outerHTML` | All | `divElem.outerHTML = "<div>Hello " + userControlledVal + "</div>"`
`anyElement.insertAdjacentHTML` | All | `divElem.insertAdjacentHTML("","<b>"+ userControlledVal + "</b>");)`
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the last parenthesis is on purpose:

Suggested change
`anyElement.insertAdjacentHTML` | All | `divElem.insertAdjacentHTML("","<b>"+ userControlledVal + "</b>");)`
`anyElement.insertAdjacentHTML` | All | `divElem.insertAdjacentHTML("","<b>"+ userControlledVal + "</b>");`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant