Commit 8f6c5870 authored by Ben Noordhuis's avatar Ben Noordhuis Committed by Fedor Indutny
Browse files

src: ignore risky env vars when setuid root

On POSIX platforms, check that the uid and gid match the euid and egid
respectively before looking up the environment variable.

Before this commit, an i18n-enabled suid node would cheerfully load
attacker-controlled ICU data through the NODE_ICU_DATA environment
variable.

This commit is not a complete fix.  For example, it's up for debate
what to do with the NODE_CHANNEL_FD environment variable.

PR-URL: https://github.com/node-forward/node/pull/18


Reviewed-By: default avatarFedor Indutny <fedor@indutny.com>
parent 5fdff385
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment