Skip to content

add security middleware to block malicious paths#3102

Merged
syphar merged 1 commit into
rust-lang:mainfrom
syphar:filter-malicious
Dec 25, 2025
Merged

add security middleware to block malicious paths#3102
syphar merged 1 commit into
rust-lang:mainfrom
syphar:filter-malicious

Conversation

@syphar
Copy link
Copy Markdown
Member

@syphar syphar commented Dec 25, 2025

There were a bunch of sentry errors from someone trying to break in into our system via relativ paths, or invalid UTF-8.

Instead of trying to handle these errors in the whole codebase, we just fully block these URLs.

I also thought about using the CDN to block these, but then decided to have it here for consistency.

If the middleware gets too big, we could think about this:
https://www.fastly.com/documentation/guides/next-gen-waf/using-ngwaf/signals/using-system-signals/

related but not needed:
#3101

@syphar syphar self-assigned this Dec 25, 2025
@syphar syphar requested a review from a team as a code owner December 25, 2025 14:35
@syphar syphar changed the title add security middleware to block malicious paths, real error for docs_rs_uri add security middleware to block malicious paths Dec 25, 2025
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Dec 25, 2025
@syphar

This comment was marked as outdated.

@syphar syphar merged commit fa0bc9f into rust-lang:main Dec 25, 2025
12 checks passed
@syphar syphar deleted the filter-malicious branch December 25, 2025 15:31
@github-actions github-actions Bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Dec 25, 2025
@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Jan 3, 2026
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.

2 participants