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

🚨 [security] [php] Update symfony/http-foundation 7.1.6 β†’ 7.1.7 (patch) #140

Merged

Conversation

depfu[bot]
Copy link
Contributor

@depfu depfu bot commented Nov 6, 2024


🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

↗️ symfony/http-foundation (indirect, 7.1.6 β†’ 7.1.7) Β· Repo Β· Changelog

Security Advisories 🚨

🚨 Symfony vulnerable to open redirect via browser-sanitized URLs

Description

The Request class, does not parse URI with special characters the same way browsers do. As a result, an attacker can trick a validator relying on the Request class to redirect users to another domain.

Resolution

The Request::create methods now assert the URI does not contain invalid characters as defined by https://url.spec.whatwg.org/

The patch for this issue is available here for branch 5.4.

Credits

We would like to thank Sam Mush for reporting the issue and Nicolas Grekas for providing the fix.

Release Notes

7.1.7

Changelog (v7.1.6...v7.1.7)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by 11 commits:


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

Summary by Sourcery

Update symfony/http-foundation from version 7.1.6 to 7.1.7 to address a security vulnerability related to open redirects and fix a bug with \SplTempFileObject support in BinaryFileResponse.

Bug Fixes:

  • Fix support for \SplTempFileObject in BinaryFileResponse.

Enhancements:

  • Reject URIs that contain invalid characters to prevent open redirect vulnerabilities.

@depfu depfu bot added the depfu label Nov 6, 2024
Copy link

korbit-ai bot commented Nov 6, 2024

By default, I don't review pull requests opened by bots. If you would like me to review this pull request anyway, you can request a review via the /korbit-review command in a comment.

Copy link

Review changes with Β SemanticDiff

Copy link

Open Redirect

Play SecureFlagPlay Labs on this vulnerability with SecureFlag!

Description

Open Redirects, otherwise known as Unvalidated Redirects and Forwards, are a class of vulnerability made possible when a web application, comprised of insufficient input-validation controls, is manipulated into redirecting unwitting users of the application to a malicious, attacker-controlled URL.

This type of exploit is popular with criminals involved in phishing and credential theft, unsurprising given the false layer of trust attributed to the fact that the modified link and the original site share the same server name.

Read more

Impact

There are many overlapping techniques criminals employ to dupe unwitting victims into handing over their hard-earned cash. One of these methods is undoubtedly betting on the misplaced trust many of us place in familiar server names. This write-up exemplifies how even the most arguably well-known URL of all, https://www.google.com, can be taken advantage of via its redirection facility.

In addition, Open Redirect vulnerabilities can:

  • Lead to Cross-Site Scripting (XSS) attacks if the redirect uses data: or javascript: protocols;
  • Potentially circumvent Server-Side Request Forgery (SSRF) filters;
  • Nullify allow list effectiveness in some cases to bypass Content Security Policy (CSP);
  • Lead to Carriage Return and Line Feed (CRLF) attacks if line breaks are present in the destination parameter.

Scenarios

As outlined above, attackers often use this attack as it 'hijacks' the trust users place in a well-known URL.

Here's a topical example from 2021; if the target domain is www.covidvaccinations.com, an attacker might craft the following URL:

http://www.covidvaccinations.com/redirect.php?url=http://attackerwebsite.com

Attackers send links like the one above in phishing campaigns in the hopes that they will lure a victim into clicking on the link.

Prevention

The following measures can be applied to either eliminate or drastically reduce the potential for Open Redirect exploitation:

  • If they aren't necessary, don't use redirects and forwards!
  • In cases where they are required, do not allow the URL as user input for the destination;
  • When user input is unavoidable, validate the supplied value, its appropriateness for the application, and ensure it is authorized for the user:
    • This can be a fiddly task, so closely adhere to best practices and ensure continued maintenance.
  • If possible, force the user to provide an ID or token that is mapped server-side to a complete target URL;
  • Input sanitization should be implemented by creating an allow list of trusted URLs determined by host or regex.

Testing

Verify that URL redirects and forwards only allow destinations which appear on an allow list, or show a warning when redirecting to potentially untrusted content.

View this in the SecureFlag Knowledge Base

Copy link

sourcery-ai bot commented Nov 6, 2024

Reviewer's Guide by Sourcery

This security update addresses a vulnerability in symfony/http-foundation where the Request class could be tricked into redirecting users to malicious domains due to improper URI parsing. The update also includes a fix for SplTempFileObject support in BinaryFileResponse.

Class diagram for symfony/http-foundation update

classDiagram
    class Request {
        +create(uri: String)
        +assertValidUri(uri: String)
    }
    note for Request "The create method now asserts the URI does not contain invalid characters."

    class BinaryFileResponse {
        +supportSplTempFileObject()
    }
    note for BinaryFileResponse "Fix support for SplTempFileObject."
Loading

File-Level Changes

Change Details Files
Security fix for URI parsing vulnerability
  • Added validation to reject URIs containing invalid characters as defined by the WHATWG URL specification
  • Updated Request::create methods to properly validate URIs
  • Prevents potential open redirect attacks through browser-sanitized URLs
composer.lock
Bug fix for file response handling
  • Fixed support for SplTempFileObject in BinaryFileResponse
  • Improved compatibility with temporary file handling
composer.lock

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

pr-code-reviewer bot commented Nov 6, 2024

πŸ‘‹ Hi there!

Everything looks good!


Automatically generated with the help of gpt-3.5-turbo.
Feedback? Please don't hesitate to drop me an email at webber@takken.io.

Copy link

gooroo-dev bot commented Nov 6, 2024

Please double check the following review of the pull request:

Issues counts

🐞Mistake πŸ€ͺTypo 🚨Security πŸš€Performance πŸ’ͺBest Practices πŸ“–Readability ❓Others
0 0 0 0 0 0 0

Changes in the diff

Since the diff provided is empty, there are no changes to summarize.

Identified Issues

There are no identified issues because the diff is empty.

Missing Tests

Since there are no changes in the diff, there are no missing tests to generate.

Summon me to re-review when updated! Yours, Gooroo.dev
Feel free to add a reaction or reply with your thoughts!

Copy link

coderabbitai bot commented Nov 6, 2024

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Potential issues, bugs, and flaws that can introduce unwanted behavior.

  1. Version Compatibility:

    • composer.lock shows an update to symfony/http-foundation from v7.1.6 to v7.1.7. It is important to verify that v7.1.7 does not introduce any breaking changes or incompatibilities with your current codebase.
    • File: composer.lock
  2. GitHub Reference Update:

    • The reference has been changed from an earlier specific commit to a new one. Make sure the new commit 5183b61657807099d98f3367bcccb850238b17a9 is stable and tested in the context of your application to prevent any regression issues.
    • File: composer.lock

Code suggestions and improvements for better exception handling, logic, standardization, and consistency.

  1. Lock File Maintenance:

    • Ensure that any necessary functional tests are executed following updates to dependencies specified in composer.lock. This ensures that upgrading dependencies doesn’t inadvertently break functionality.
    • File: composer.lock
  2. Documentation of Changes:

    • Consider documenting each change made to composer.lock by using commit messages that describe the reason for the update, like bug fixes, new features, or dependency updates. This practice will help understand future changes and reasons later.
    • File: composer.lock
  3. Review Release Notes:

    • Review the release notes or changelog of symfony/http-foundation version 7.1.7 to understand what has changed from 7.1.6. This is especially useful for identifying new features, bug fixes, or any deprecations that could affect your project.
    • File: composer.lock

By taking these steps, you can ensure that the dependency updates made in your project maintain stability and provide long-term compatibility.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. It seems to have been created by a bot (hey, depfu[bot]!). We assume it knows what it's doing!

Copy link

instapr bot commented Nov 6, 2024

Feedback:

  • Update symfony/http-foundation to version 7.1.7.
  • Security vulnerability CVE-2024-50345 is fixed in this update.
  • Refer to the changelog for detailed changes.
  • Review and merge this PR promptly to address the known security issues.

Copy link

deepsource-io bot commented Nov 6, 2024

Here's the code health analysis summary for commits 17b83c3..aae4bb1. View details on DeepSourceΒ β†—.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource SQL LogoSQLβœ…Β SuccessView CheckΒ β†—
DeepSource Test coverage LogoTest coverageβœ…Β SuccessView CheckΒ β†—
DeepSource Secrets LogoSecretsβœ…Β SuccessView CheckΒ β†—
DeepSource PHP LogoPHPβœ…Β SuccessView CheckΒ β†—
DeepSource Docker LogoDockerβœ…Β SuccessView CheckΒ β†—

Code Coverage Report

MetricAggregatePhp
Branch Coverage100%100%
Composite Coverage33.3%33.3%
Line Coverage33.3%33.3%

πŸ’‘ If you’re a repository administrator, you can configure the quality gates from the settings.

@github-actions github-actions bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 6, 2024
@guibranco guibranco enabled auto-merge (squash) November 6, 2024 16:07
@gstraccini gstraccini bot added the β˜‘οΈ auto-merge Automatic merging of pull requests (gstraccini-bot) label Nov 6, 2024
Copy link
Member

@guibranco guibranco left a comment

Choose a reason for hiding this comment

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

Automatically approved by gstraccini[bot]

@gstraccini gstraccini bot added the πŸ€– bot Automated processes or integrations label Nov 6, 2024
@guibranco
Copy link
Member

@depfu merge

Copy link

sonarqubecloud bot commented Nov 6, 2024

Copy link

github-actions bot commented Nov 6, 2024

Infisical secrets check: βœ… No secrets leaked!

πŸ’» Scan logs
4:07PM INF scanning for exposed secrets...
4:07PM INF 134 commits scanned.
4:07PM INF scan completed in 356ms
4:07PM INF no leaks found

@guibranco guibranco merged commit fdc8166 into main Nov 6, 2024
23 checks passed
@guibranco guibranco deleted the depfu/update/composer/symfony/http-foundation-7.1.7 branch November 6, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
β˜‘οΈ auto-merge Automatic merging of pull requests (gstraccini-bot) πŸ€– bot Automated processes or integrations depfu size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant