CWE-276: Incorrect default permissions | Causes and Fixes Skip to content

Security weakness

CWE-276 Incorrect default permissions

Files, folders or cloud storage are created with access that is far wider than they need.

  • Senior security engineers
  • 540+ projects delivered
  • Reply within one business day

Quick answer

What is CWE-276?

Incorrect Default Permissions: During installation, installed file permissions are set to allow anyone to modify those files.

Business impact

What CWE-276 could cost your business

MITRE documents what this weakness can do. Here is what that means for a website, store or app.

Confidentiality

Private data exposed

Customer records, credentials, orders or internal files can be read by people who should never see them.

  • Read Application Data
  • Modify Application Data

Integrity

Data, pages or code changed

Prices, orders, content or the code your site runs can be altered without your approval.

  • Read Application Data
  • Modify Application Data

In plain English

What Incorrect default permissions means for your business

  • 540+projects delivered
  • 9+years in business
  • 23+certified experts
Get a free security check

A senior engineer replies within one business day.

When software is installed or creates new files, it assigns permissions that decide who can read, change or run them. This weakness means those starting permissions are too generous, for example files that any account on the server can modify. Nobody chose to open them up. They simply arrived that way and were never tightened, so the gap goes unnoticed until someone looks for it.

Loose permissions rarely cause a breach alone, but they turn a small problem into a large one. If an attacker gets a foothold through a weak plugin or a neighboring site on shared hosting, writable files let them plant a backdoor or alter your code, and readable configuration files hand over database passwords. Correct permissions limit how far an intruder can go.

Where it shows up

  • WordPress, Magento or other PHP sites where files and folders were set to world-writable, often with mode 777, to get past an install or upload error.
  • Configuration files holding database passwords and API keys, such as wp-config.php or .env files, readable by every user on a shared server.
  • Cloud storage buckets, file shares or database instances created with public or organization-wide access because the default or a template allowed it.
  • Installers, deployment scripts and container images that create files as the root user or with open permissions that the running application never needed.

Free security check

Is CWE-276 hiding in your site?

A senior engineer checks your site, store or app for this weakness and the rest of the CWE Top 25, then sends a prioritized fix plan within one business day. No obligation.

Official definition

How MITRE defines CWE-276

Incorrect Default Permissions

During installation, installed file permissions are set to allow anyone to modify those files.

Weakness ID
CWE-276
Type
Base
Status
Draft
Likelihood of exploit
Medium
Applies to
ICS/OT
Introduced during
Architecture and Design, Implementation, Installation, Operation

Fix it

How to fix Incorrect default permissions

Practical steps in priority order. Share them with your developer or agency.

  1. Set least-privilege file permissions

    Use 644 for files and 755 for directories as a baseline, with 600 or 640 for configuration files containing secrets. Remove world-writable permissions everywhere and never use 777 as a workaround.

  2. Separate code ownership from the web server

    Have a deploy user own application code and give the web server process read-only access. Grant write access only to specific upload and cache directories, and block script execution inside them.

  3. Set safe defaults for new files

    Configure a restrictive umask, such as 027, for the application and deployment users so newly created files start locked down. In code, pass explicit permissions when creating files rather than relying on defaults.

  4. Lock down cloud defaults

    Enable account-level public access blocks on storage, define permissions in infrastructure-as-code templates and grant access through narrowly scoped roles. Review every resource created from a quick-start template or console wizard.

  5. Audit permissions continuously

    Run a scheduled check that reports world-writable files, files owned by unexpected users and publicly accessible storage. Include permission checks in your deployment pipeline so every release resets them to the known-good state.

Signs you may be affected

  • Files or directories on your server are writable by all users.
  • The web server process owns and can modify your application code.
  • A cloud storage bucket or backup folder can be listed or downloaded without logging in.

Questions to ask your developer

  • Are any files or folders on our server writable by everyone?
  • Can the web server modify our application code or configuration files?
  • Is any of our cloud storage publicly readable, and is that intentional?

Prevention

What MITRE recommends, phase by phase

Every mitigation from the CWE entry, in the order a project runs: plan, build, test, operate.

  1. 01

    Architecture and Design

    • The architecture needs to access and modification attributes for files to only those users who actually require those actions.
    • Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces.

Detection and evidence

How CWE-276 is found, and where it has hit

The testing methods MITRE recommends, and real vulnerabilities this weakness has caused.

How it is detected

  • Automated Static Analysis – Binary or BytecodeAccording to SOAR [REF-1479], the following detection techniques may be useful: Inter-application Flow Analysis
  • Manual Static Analysis – Binary or BytecodeAccording to SOAR [REF-1479], the following detection techniques may be useful: Binary / Bytecode disassembler – then use manual analysis for vulnerabilities & anomalies
  • Dynamic Analysis with Automated Results InterpretationAccording to SOAR [REF-1479], the following detection techniques may be useful: Host-based Vulnerability Scanners – Examine configuration for flaws, verifying that audit mechanisms work, ensure host configuration meets certain predefined criteria Web Application Scanner Web Services Scanner Database.
  • Dynamic Analysis with Manual Results InterpretationAccording to SOAR [REF-1479], the following detection techniques may be useful: Host Application Interface Scanner Fuzz Tester Framework-based Fuzzer Automated Monitored Execution Forced Path Execution
  • Manual Static Analysis – Source CodeAccording to SOAR [REF-1479], the following detection techniques may be useful: Manual Source Code Review (not inspections) Focused Manual Spotcheck – Focused manual analysis of source

Real vulnerabilities it caused

  • CVE-2005-1941Executables installed world-writable.
  • CVE-2002-1713Home directories installed world-readable.
  • CVE-2001-1550World-writable log files allow information loss; world-readable file has cleartext passwords.
  • CVE-2002-1711World-readable directory.
  • CVE-2002-1844Windows product uses insecure permissions when installing on Solaris (genesis: port error).
  • CVE-2001-0497Insecure permissions for a shared secret key file. Overlaps cryptographic problem.

How we fix it

From finding to fixed: how Codefreex closes CWE-276

  1. 01

    Scan and confirm

    We test your site, store or app for this weakness and the rest of the CWE Top 25 with automated scanning and manual review, and confirm what is actually exploitable.

  2. 02

    Fix at the source

    We change the code, configuration or dependency that causes it, not just the symptom, and plan the changes to avoid downtime.

  3. 03

    Verify the fix

    We retest every finding, check that nothing else broke and hand you a short report you can share with your team, client or auditor.

  4. 04

    Keep it fixed

    Updates, monitoring and maintenance so the weakness does not return with the next plugin, theme, app or code change.

Related weaknesses

FAQ

CWE-276: FAQs

Short answers for owners and developers. Not sure whether your site is affected? Ask us to check.

What are default permissions and why do they matter?

They are the access settings a file, folder or cloud resource receives when it is first created. If those defaults are too open, everything created afterwards inherits the problem without anyone deciding it. Permissions matter because they limit damage: an attacker who gets partway in can only read or change what the compromised account is allowed to touch.

How serious is this weakness?

On its own it is typically medium severity, since an attacker usually needs some access first. Its real effect is on how bad other incidents become. Writable code lets a minor compromise turn into a persistent backdoor, and readable secrets expose your database. Publicly accessible cloud storage is the exception and can be a direct data leak.

How do I fix and prevent permission problems?

Apply least privilege: each account gets only the access it needs. Set standard file modes, separate the code owner from the web server user and restrict write access to upload folders. Bake these settings into deployment scripts and cloud templates so they are applied every time, and run regular scans for world-writable files and public storage.

What is CWE-276?

CWE-276, “Incorrect Default Permissions”, is a software weakness catalogued by MITRE in the Common Weakness Enumeration. During installation, installed file permissions are set to allow anyone to modify those files.

How serious is CWE-276?

MITRE rates the likelihood of exploit as Medium. It can affect confidentiality, integrity, with impacts such as read application data, modify application data. The real risk depends on where the weakness sits and what data or functions it exposes.

How do you prevent CWE-276?

The architecture needs to access and modification attributes for files to only those users who actually require those actions. Compartmentalize the system to have “safe” areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when.

Can Codefreex check my site for CWE-276?

Yes. A senior engineer reviews your site, store or app for CWE-276 and the rest of the CWE Top 25, confirms what is exploitable and sends a prioritized fix plan within one business day. Start with the free security check form on this page.

Free security check

Find out if CWE-276 affects your site

Send your URL. A senior engineer checks for this weakness and the rest of the CWE Top 25, and replies within one business day with what to fix first.

  • A senior strategist reviews your request, not a sales bot
  • Clear scope, timeline and estimate within one business day
  • Free 30-minute discovery call, no obligation
  • NDA available on request

Weakness data from the Common Weakness Enumeration (CWE®) version 5.0, Copyright © 2006–2026, The MITRE Corporation. CWE is free to use by any organization or individual for any research, development, and/or commercial purposes under the CWE Terms of Use. CWE is a registered trademark of The MITRE Corporation. The business impact, risk profile and plain-English guidance on this page are written by Codefreex and are general information, not a security assessment of your system.