mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
Harden Node tool execution with --permission flag
Add security.node.permissions config to run Node tools (PostCSS, Babel, TailwindCSS) under Node's permission model, restricting file system access to the working directory by default. The binary resolution is simplified to node_modules/.bin → PATH (npx removed). For both locations, the actual JS entry point is resolved via symlinks (macOS/Linux) or by parsing npm wrapper scripts (Windows .cmd), then executed as "node --permission --allow-fs-read=<path> --allow-fs-write=<path> <script>". Users can opt out by removing "node" from security.exec.allow. Closes #7287
This commit is contained in:
@@ -42,6 +42,10 @@ jobs:
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: "22"
|
||||
- name: Install Ruby
|
||||
uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user