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

add https connection and allowed hosts check #1575

Merged
merged 9 commits into from
Dec 19, 2023

Conversation

MattSilverio
Copy link
Contributor

Resolving problem to issue #1553

Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

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

The security issue highlighted concerns untrusted URL redirection from a remote source, where user input is incorporated into a URL redirect without full validation, leading to potential phishing attacks (CWE-601). The proposed change ensures that the scheme is HTTPS and the netloc is in the allowed hosts. However, this may not fully mitigate the risk as it does not address the validation of the entire URL, such as the path and query parameters which can also be exploited.

To address the issue more comprehensively, consider implementing the following:

  1. Validate the full URL structure, not just the scheme and netloc.
  2. Ensure that the path and query parameters do not redirect to an untrusted page even if the netloc is within the allowed hosts.
  3. Use a list of allowed paths or a regular expression to validate the entire redirection endpoint.
  4. Employ a safe redirect function that only redirects to known-safe URLs defined within the application.

Implementing these additional checks will help to ensure that the application is not vulnerable to open redirection attacks stemming from user input.

@JisanAR03
Copy link
Contributor

@MattSilverio the github , google and facebook callback function have to be updated. What you have to do is : read those social media documents and implement it on the BLT, which I'm going gonna do after few days, or if you can do that, implement this one, but don't do something like sanitization system cause this is mainly feature problem, not a security one. best of luck ☺

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

MattSilverio

This comment was marked as duplicate.

Copy link
Contributor Author

@MattSilverio MattSilverio left a comment

Choose a reason for hiding this comment

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

Additional checks implemented as requested, @DonnieBLT

MattSilverio

This comment was marked as resolved.

Copy link
Collaborator

@DonnieBLT DonnieBLT left a comment

Choose a reason for hiding this comment

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

looks good, just let me know about the file

.github/workflows/codeql.yml Outdated Show resolved Hide resolved
@DonnieBLT DonnieBLT enabled auto-merge (rebase) December 19, 2023 02:38
@DonnieBLT DonnieBLT merged commit c1bdaaa into OWASP-BLT:main Dec 19, 2023
6 checks passed
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.

None yet

4 participants