Medium severityGoOther Security ChecksMEDIUM confidence
Permissive File Permissions
A file or directory is created/changed with world-writable or world-readable permissions (0777/0666), letting any local user read or tamper with it (CWE-732/CWE-276).
Standards mapping
- CWE
- CWE-732: Incorrect Permission Assignment for Critical ResourceCWE-276: Incorrect Default Permissions
- OWASP Top 10
- A01:2021 - Broken Access Control
- OWASP ASVS
- V12.3.1 (L1)
Vulnerable vs. safe
Flagged by this check
_ = os.WriteFile("/var/app/config.json", data, 0666)Passes - the safe pattern
_ = os.WriteFile("/var/app/config.json", data, 0600)Why it matters & how to fix it
A file or directory is created/changed with world-writable or world-readable permissions (0777/0666), letting any local user read or tamper with it (CWE-732/CWE-276). Grant the least privilege required: 0600 for secrets/private files, 0644 for files that must be world-readable, 0700/0750 for directories. Never use 0777 or 0666.
References
Rule ID integsec-go-permissive-file-permissions - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Other Security ChecksChild Process Shell True
- JavaScript / TypeScript - Other Security ChecksOpen Redirect Tainted Input
- Python - Other Security ChecksDjango Mark Safe
- Python - Other Security ChecksFlask Debug Enabled
- Python - Other Security ChecksFlask Render Template String
- Python - Other Security ChecksInsecure Tempfile Mktemp