-
Notifications
You must be signed in to change notification settings - Fork 36
Fix insecure temporary file creation (CWE-377) with secure file permissions #10000
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
Conversation
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
|
@copilot The original prompt told you to use the |
|
@eaftan we do not have any npm dependencies |
Co-authored-by: eaftan <4733401+eaftan@users.noreply.github.com>
Done! I've updated the code to use the Changes in commit ed7b174:
CodeQL security scanner confirms 0 JavaScript alerts. |
|
@copilot revert the previous commit |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Reverted in commit 9cbe53f. Removed the CodeQL security scanner still shows 0 JavaScript alerts - the security issue is resolved without adding external dependencies. |
|
@copilot format, lint |
All files are already properly formatted and linted - no changes needed. ✓ |
CodeQL flagged
fs.writeFileSync()inactions/setup/src/index.jsfor creating files in/tmpwithout secure permissions, making them readable by other users (CWE-377).Changes
fs.writeFileSync()- files are now only readable/writable by ownerfs.mkdirSync()- directories are now only accessible by ownerThis implementation uses Node.js built-in
fsmodule with secure file permissions, ensuring files are inaccessible to other users without adding external dependencies.Platform Compatibility
Verification
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.