nodejs / nodejs/node

setcap on Node.js prevents processing of NODE_OPTIONS

Open
#37,588 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

linux security
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

  • Version: v15.11.0
  • Platform: Linux connor-Virtual-Machine 5.4.0-66-generic
  • Subsystem: unknown
What steps will reproduce the bug?
  1. sudo setcap cap_net_admin+iep $(which node)
  2. Attempt to use anything in the NODE_OPTIONS environment variable
  3. Nothing happens
How often does it reproduce? Is there a required condition?

100% of the time

What is the expected behavior?

I would expect NODE_OPTIONS to be processed regardless.

What do you see instead?

Additional information

Reported on https://github.com/microsoft/vscode-js-debug/issues/852

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Linux command sudo setcap cap_net_admin+iep $(which node) with a NODE_OPTIONS value, then trace Node.js startup handling for environment options when capabilities are set. Done means NODE_OPTIONS is processed under this condition, with coverage for the reported v15.11.0 behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, linux, node.js
Domain
operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.