Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gaetan-ferry-sonarsource
Copy link
Contributor

Review

A dedicated reviewer checked the rule description successfully for:

  • logical errors and incorrect information
  • information gaps and missing content
  • text style and tone
  • PR summary and labels follow the guidelines

Copy link
Contributor

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

Choose a reason for hiding this comment

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

Suggested change
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());

Choose a reason for hiding this comment

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

Suggested change
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")) {

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.

Copy link
Contributor

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]>
Copy link

sonarqube-next bot commented Jun 6, 2024

Quality Gate passed Quality Gate passed for 'rspec-frontend'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Copy link

sonarqube-next bot commented Jun 6, 2024

Quality Gate passed Quality Gate passed for 'rspec-tools'

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants