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

Pushing test for Persistent XSS in HTML #455

Merged
merged 4 commits into from
Nov 29, 2023
Merged

Conversation

SeheX
Copy link
Contributor

@SeheX SeheX commented Nov 18, 2023

No description provided.


@Test
public void testGetVulnerablePayloadLevel7() {
Map<String, String> queryParams = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

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

i think we can use collections.singletonMap


ResponseEntity<String> response = vulnerability.getVulnerablePayloadLevel1(queryParams);

verify(postRepository, times(1)).save(any());
Copy link
Member

Choose a reason for hiding this comment

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

shall we also assert on the arguments passed to the postRepository?

}

@Test
public void testGetVulnerablePayloadLevel6() {
Copy link
Member

Choose a reason for hiding this comment

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

I think adding a few tests would help here like input having NullByte and its impact on level 6 and level 5.


ResponseEntity<String> response = vulnerability.getVulnerablePayloadLevel4(queryParams);

verify(postRepository, times(1)).save(any());
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to add a few more granular level of assertions then just verifying the call to postRepository.

@SeheX
Copy link
Contributor Author

SeheX commented Nov 27, 2023

Can you check ? Is it good like this ?

Copy link
Member

@preetkaran20 preetkaran20 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot for the PR.

@preetkaran20
Copy link
Member

@SeheX Thanks a lot for the PR !!!

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