Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setcap on Node.js prevents processing of NODE_OPTIONS #37588

Open
connor4312 opened this issue Mar 3, 2021 · 4 comments
Open

setcap on Node.js prevents processing of NODE_OPTIONS #37588

connor4312 opened this issue Mar 3, 2021 · 4 comments
Labels
linux Issues and PRs related to the Linux platform. security Issues and PRs related to security.

Comments

@connor4312
Copy link
Contributor

  • 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 microsoft/vscode-js-debug#852

@addaleax
Copy link
Member

I think @danbev's #37727 might address this.

@targos targos added linux Issues and PRs related to the Linux platform. security Issues and PRs related to security. labels Aug 9, 2021
@drazisil
Copy link

When did this behavior break? It doesn't look like the code changed. Is this a change in kernel security?

@Busyrev
Copy link

Busyrev commented Dec 26, 2021

Reproduced on 17.3.0. Its very important for debugging sсripts that using Bluetooth and GPIO. Please fix it.

@lesmo
Copy link

lesmo commented Apr 17, 2023

Just wanted to share this is also happening for node v14 under Linux. The annoying part is it took me hours to land at this conclusion.

The only workaround seems to be NOT using setcap... some alternatives include just using any other port not requiring elevated privileges, some iptables stuff or running with authbind instead (but I havent tried it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
linux Issues and PRs related to the Linux platform. security Issues and PRs related to security.
Projects
None yet
Development

No branches or pull requests

6 participants