Skip to content

Conversation

@patak-dev
Copy link
Member

fix #19914

Description

Whitelist virtual modules from fs serving access check

Comment on lines +268 to +271
return (
id.startsWith('\0') ||
!deniedServingAccessForTransform(id, server, res, next)
)
Copy link
Member Author

Choose a reason for hiding this comment

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

The test will pass without this added check because of the fallback logic added to deniedServingAccessForTransform, but if we know the id is a virtual module, then we can skip the check directly.

'',
)
if (
!url.startsWith('/@id/\0') &&
Copy link
Member Author

Choose a reason for hiding this comment

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

At this point, we have replaced the NULL_BYTE_PLACEHOLDER but didn't yet unwrapped the id. We could actually remove the whole check now that we are doing it before load but leaving that to be done in a separate PR.

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

LGTM

@patak-dev patak-dev merged commit 7dfcb31 into main Jun 3, 2025
26 checks passed
@patak-dev patak-dev deleted the fix/virtual-svg-module branch June 3, 2025 11:06
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.

Virtual modules ending in *.svg fail to load

3 participants