This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Escaping html tag to prevent xss #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📊 Metadata *
Bounty URL: https://www.huntr.dev/bounties/1-maven-xmppserver/
⚙️ Description *
In the page used to delete the group, the (dangerous) group name characters that can cause an XSS are transformed in a way the are not dangerous any more, preserving the correct name visualization of the group name
💻 Technical Description *
The XSS payload was printed in the html template without escaping/encoding the dangerous characters. The proposed fix uses a method in the StringUtil class (already present in the project) that HTML-escapes dangerous characters and the payload doesn't work any more
🐛 Proof of Concept (PoC) *
The screenshot shows the triggered XSS due to the printed payload (as is ) in the html of the page causing the xss at the opening of the page

🔥 Proof of Fix (PoF) *
The screenshot shows the payload of XSS is now HTML-escaped so the correct view of group name is preserved but the payload can create anymore a script context to trigger the XSS
👍 User Acceptance Testing (UAT)
After the fix, the page is still working correctly allowing the user to delete the desired group