src: let embedders exempt linked bindings from the addon permission - #66067
Open
codebytere wants to merge 1 commit into
Open
codebytere wants to merge 1 commit into
codebytere wants to merge 1 commit into
Conversation
process._linkedBinding() is subject to the permission model's addon scope since the check was added to GetLinkedBinding(). For an embedder that implements part of its runtime as linked bindings this means its own bootstrap cannot reach them under --permission unless the user also passes --allow-addons, which allows loading addons from the file system as well. Add EnvironmentFlags::kNoAddonPermissionForLinkedBindings. When set, GetLinkedBinding() skips the addon permission check for that Environment and the worker threads it creates; process.dlopen() stays gated and the default behavior is unchanged. Refs: nodejs#65432 Signed-off-by: Shelley Vohr <shelley.vohr@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #66067 +/- ##
==========================================
- Coverage 90.27% 90.26% -0.01%
==========================================
Files 789 789
Lines 271473 271480 +7
Branches 51808 51815 +7
==========================================
- Hits 245066 245064 -2
- Misses 16880 16885 +5
- Partials 9527 9531 +4
🚀 New features to boost your workflow:
|
legendecas
approved these changes
Sep 16, 2026
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
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.
Refs: #65432
Since #65432
process._linkedBinding()is subject to the permission model's addon scope, the same asprocess.dlopen(). A stocknodebinary has no linked bindings, so this only affects embedders, and for an embedder that implements part of its runtime as linked bindings (NODE_LINKED_MODULE/node::AddLinkedBinding()) it means its own bootstrap cannot reach them under--permissionunless the user also passes--allow-addons- which then allows loading addons from the file system as well.This adds
EnvironmentFlags::kNoAddonPermissionForLinkedBindings. When an embedder sets it,GetLinkedBinding()skips the addon permission check for that Environment and the worker threads it creates;process.dlopen()stays gated by--allow-addonsand the default behavior is unchanged. The reasoning is that--allow-addonsguards loading native code from disk at runtime, while linked bindings are compiled into the executable by the embedder and trusted the same way the built-in bindings are.Disclosure: the code, tests and this description were written by Claude Code, directed and reviewed by @codebytere.