-
Notifications
You must be signed in to change notification settings - Fork 31
Modify rule S5146: Adding education content for Micronaut (APPSEC-1783) #3968
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
base: master
Are you sure you want to change the base?
Modify rule S5146: Adding education content for Micronaut (APPSEC-1783) #3968
Conversation
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.
I added some comments.
@Get("/Noncompliant/httpresponse") | ||
public HttpResponse<String> noncompliant(@QueryValue("q") String location) throws URISyntaxException { | ||
URI url = new URI(location); | ||
return HttpResponse.redirect(url); //Noncompliant |
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.
return HttpResponse.redirect(url); //Noncompliant | |
return HttpResponse.redirect(url); // Noncompliant |
---- | ||
@Get("/Compliant/httpresponse") | ||
public HttpResponse<String> compliant(@QueryValue("q") String location) throws URISyntaxException { | ||
URI url = new URI(location.get()); |
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.
URI url = new URI(location.get()); | |
URI url = new URI(location); |
public HttpResponse<String> compliant(@QueryValue("q") String location) throws URISyntaxException { | ||
URI url = new URI(location.get()); | ||
String host = url.getHost(); | ||
if (host != null && host.endsWith(".example.com")) { |
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.
Same comment as in the PoC that this might still allow the redirection to a different port.
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.
One typo left. Otherwise LGTM! ✅
Co-authored-by: daniel-teuchert-sonarsource <[email protected]>
|
|
Review
A dedicated reviewer checked the rule description successfully for: