Skip to content

fix(core): block user ext imports after resolution#36012

Merged
nathanwhit merged 2 commits into
denoland:mainfrom
nathanwhit:fix/internal-module-load-context
Jul 14, 2026
Merged

fix(core): block user ext imports after resolution#36012
nathanwhit merged 2 commits into
denoland:mainfrom
nathanwhit:fix/internal-module-load-context

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

This keeps internal ext: module loading tied to the resolved module context.

The module map now rejects resolved internal module specifiers when they are requested from ordinary file modules, including after loader resolution. This also covers node:vm default-loader paths where filenames can be caller-controlled.

Tests:

  • cargo test -p deno_core module_map_rejects_user_ext_imports_after_resolution -- --nocapture
  • cargo test -p unit_node_tests --test unit_node -- unit_node::vm_test --nocapture
  • cargo fmt --check

@nathanwhit
nathanwhit marked this pull request as ready for review July 13, 2026 19:30
@nathanwhit
nathanwhit merged commit 25f763b into denoland:main Jul 14, 2026
268 of 270 checks passed
bartlomieju pushed a commit that referenced this pull request Jul 15, 2026
This keeps internal `ext:` module loading tied to the resolved module
context.

The module map now rejects resolved internal module specifiers when they
are requested from ordinary file modules, including after loader
resolution. This also covers `node:vm` default-loader paths where
filenames can be caller-controlled.

Tests:
- `cargo test -p deno_core
module_map_rejects_user_ext_imports_after_resolution -- --nocapture`
- `cargo test -p unit_node_tests --test unit_node -- unit_node::vm_test
--nocapture`
- `cargo fmt --check`
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