Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update navtree.js DOM text reinterpreted as HTML #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Shivam7-1
Copy link

By using textContent, it will avoid the risk of HTML injection, as these properties automatically escape any HTML special characters in the provided text. This helps prevent cross-site scripting (XSS) vulnerabilities by treating the input as plain text rather than interpreted HTML.

@Shivam7-1
Copy link
Author

Hi @odbol Could You Please Review This PR
Thanks

@Shivam7-1
Copy link
Author

Hi @odbol or @andreasnilsson Could You Please Review This PR
Thanks

@Shivam7-1
Copy link
Author

Hi @odbol or @andreasnilsson Could You Please Review This PR
Thanks

@odbol
Copy link
Collaborator

odbol commented May 5, 2024

I'm not convinced this is actually a vulnerability. Can you please provide an example of how someone could inject XSS using this?

@Shivam7-1
Copy link
Author

Hi @odbol Thanks For Reviewing PR
As Google bans use of assignment to innerHTML - with the exception of the empty string. That said, there's no harm in changing this.

However, textContent is vastly preferred over innerText OR Innerhtml https://kellegous.com/j/2013/02/27/innertext-vs-textcontent/

https://builtin.com/software-engineering-perspectives/innerhtml-vs-innertext

Thanks

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.

2 participants