nodejs / nodejs/node-gyp

GitHub CodeQL reports for overly permissive file permissions

Open
#3,267 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.7k
Forks
1.9k
Avg merge
1d 4h
Merged PRs (30d)
5

Description

CodeQL has a Python rule with ID py/overly-permissive-file which flags several chmod/open calls in the node-gyp Python code. I would like to confirm that these operations are intentionally more permissive and safe to suppress.

Flagged locations

File Line Code CodeQL concern
gyp/pylib/gyp/common.py 561 os.chmod(tool_path, 0o755) World readable
gyp/pylib/gyp/flock_tool.py 43 os.open(lockfile, ..., 0o666) World readable/writable
gyp/pylib/gyp/mac_tool.py 250 os.open(lockfile, ..., 0o666) World readable/writable
  • 0o755 on common.py:561 is set because you are unsure whether all build processes are run with the same user
  • 0o666 on lock files in flock_tool.py and mac_tool.py is intentional, with umask expected to restrict actual permissions

Could you confirm these permissions are intentional and by design?

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

Review the flagged calls in gyp/pylib/gyp/common.py:561, gyp/pylib/gyp/flock_tool.py:43, and gyp/pylib/gyp/mac_tool.py:250. Start by tracing how these permissions and the process umask are used, then compare the behavior with the CodeQL rule. Done means documenting whether each operation is intentional and safe to suppress, or identifying a required change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.