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

Fix quadratic backtracking on invalid URI #2788

Merged
merged 1 commit into from
Apr 14, 2023

Conversation

lloeki
Copy link
Contributor

@lloeki lloeki commented Apr 13, 2023

What does this PR do?

Fix quadratic backtracking on invalid URI

Motivation

  • CVE-2023-28755: ReDoS vulnerability in URI
  • We vendor a partial version of the affected RFC3986_URL regex

Additional Notes

Because we only quantize URLs that are typically valid and in control of the ddtrace user instead of the general arbitrary URI case, impact should be lower than of the linked CVE.

Still, worth a fix.

Upstream details:

How to test the change?

Should still pass CI.

I did not port the test because I don't think we have any equivalent of assert_linear_performance.

Because we only quantize URLs that are typically valid and in control of
the ddtrace user instead of the general arbitrary URI case, impact should
be lower than of the linked CVE.

Still, worth a fix.

Upstream details:

- CVE report: https://www.ruby-lang.org/en/news/2023/03/28/redos-in-uri-cve-2023-28755/
- Taken from: ruby/uri@eaf89cc
- Full changeset: ruby/uri@v0.12.0...v0.12.1
@lloeki lloeki requested a review from a team April 13, 2023 21:55
@github-actions github-actions bot added integrations Involves tracing integrations tracing labels Apr 13, 2023
@lloeki lloeki merged commit 13618a3 into master Apr 14, 2023
156 checks passed
@lloeki lloeki deleted the fix-quadratic-backtracking-on-invalid-uri branch April 14, 2023 07:50
@github-actions github-actions bot added this to the 1.11.0 milestone Apr 14, 2023
@lloeki lloeki modified the milestones: 1.11.0, 1.11.0.beta1 Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Involves tracing integrations tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants