-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
Issue #316 Fixing issues in XSSInImgTagAttribute Vulnerability #366
Issue #316 Fixing issues in XSSInImgTagAttribute Vulnerability #366
Conversation
...asanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerability.java
Outdated
Show resolved
Hide resolved
...asanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerability.java
Outdated
Show resolved
Hide resolved
...asanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerability.java
Outdated
Show resolved
Hide resolved
...asanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerability.java
Outdated
Show resolved
Hide resolved
...labs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerabilityTest.java
Outdated
Show resolved
Hide resolved
...labs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerabilityTest.java
Outdated
Show resolved
Hide resolved
...labs/service/vulnerability/xss/reflected/XSSInImgTagAttributeInjectionVulnerabilityTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- renamed class and test - corrected levels - removed path traversal - changed RequestParam from map to single param - added input validation to level 7
src/main/java/org/sasanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttribute.java
Show resolved
Hide resolved
src/main/java/org/sasanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttribute.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, it LGTM, just few small questions.
src/test/java/org/sasanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttributeTest.java
Show resolved
Hide resolved
src/main/java/org/sasanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttribute.java
Outdated
Show resolved
Hide resolved
We should be all done now with your comments. Thanks for the review and all the hints and tipps :) |
src/main/java/org/sasanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttribute.java
Outdated
Show resolved
Hide resolved
src/main/java/org/sasanlabs/service/vulnerability/xss/reflected/XSSInImgTagAttribute.java
Outdated
Show resolved
Hide resolved
…oved the wrong check before
} | ||
if ((imageLocation.startsWith(IMAGE_RESOURCE_PATH) | ||
&& imageLocation.endsWith(FILE_EXTENSION)) | ||
|| allowedValues.contains(imageLocation)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| allowedValues.contains(imageLocation)
this check is also not required. and also please run ./gradlew spotlessApply
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But before you explicitly asked me to add that part. I guess, you lost me a bit, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aah no, i think there is a confusion, i asked for level6 not level7 as level7 is added by you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can even left this condition as well. please run ./gradlew spotlessApply
and we can merge this PR. thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|| allowedValues.contains(imageLocation)
this check is also not required. and also please run ./gradlew spotlessApply
Did so. Sorry, your code style differs a bit from what I'm used to. |
Hi @jpralle and other, Thanks a lot for the changes and for persistently looking into the comments. LGTM, merging it. thanks, |
Renamed class and reworked secure implementation to actually validate the input and not just use a simple allow list. Also added a unit test for the secure implementation.
This is our first open source contribution, we hope we did it in the right manner. If not, please provide some help.