-
Notifications
You must be signed in to change notification settings - Fork 45
feat: prevent processing data uri requests #675
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stas-nc
reviewed
Dec 11, 2025
ilc/server/utils/utils.spec.js
Outdated
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggesting to use .ts for new files.
stas-nc
approved these changes
Dec 11, 2025
Coverage ReportIlc/serverCommit SHA:7b8b0ea9f75a37c3408fadf6bd94890027e9264c Test coverage results 🧪File details
Ilc/clientCommit SHA:7b8b0ea9f75a37c3408fadf6bd94890027e9264c Test coverage results 🧪File details
RegistryCommit SHA:7b8b0ea9f75a37c3408fadf6bd94890027e9264c Test coverage results 🧪File details
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Block Data URI Requests to Prevent FragmentError in New Relic
Problem
Bots and misconfigured clients are making HTTP requests to data URIs (e.g.,
/data:image/svg+xml;base64,...), causing high volumes of FragmentError logs in New Relic. Data URIs are meant for inline use in HTML/CSS and should never be requested as HTTP paths.Impact
Example New Relic Error
Root Cause
isStaticFile()check (only validates.js,.js.mapextensions)Solution
Implement early rejection of data URI requests at the
onRequesthook level with a 400 Bad Request response.Key features:
DATA:,Data:,dAtA:)data%3A,%64ata:)//data:,///data:)data:,\tdata:)2. Early validation in onRequest hook (
ilc/server/app.js:48-53)Placement rationale:
Before/After Comparison
Before (FragmentError)
After (Early Rejection)