Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-552:Files or Directories Accessible to External Parties
Weakness ID:552
Version:v4.17
Weakness Name:Files or Directories Accessible to External Parties
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Draft
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product makes files or directories accessible to unauthorized actors, even though they should not be.

▼Extended Description

Web servers, FTP servers, and similar servers may store a set of files underneath a "root" directory that is accessible to the server's users. Applications may store sensitive files underneath this root without also using access control to limit which users may request those files, if any. Alternately, an application might package multiple files or directories into an archive file (e.g., ZIP or tar), but the application might not exclude sensitive files that are underneath those directories.

In cloud technologies and containers, this weakness might present itself in the form of misconfigured storage accounts that can be read or written by a public or anonymous user.

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfDiscouragedC668Exposure of Resource to Wrong Sphere
ChildOfDiscouragedC285Improper Authorization
ParentOfAllowedV527Exposure of Version-Control Repository to an Unauthorized Control Sphere
ParentOfAllowedV219Storage of File with Sensitive Data Under Web Root
ParentOfAllowedV220Storage of File With Sensitive Data Under FTP Root
ParentOfAllowedV528Exposure of Core Dump File to an Unauthorized Control Sphere
ParentOfAllowedV529Exposure of Access Control List Files to an Unauthorized Control Sphere
ParentOfAllowedV530Exposure of Backup File to an Unauthorized Control Sphere
ParentOfAllowedV539Use of Persistent Cookies Containing Sensitive Information
ParentOfAllowedV553Command Shell in Externally Accessible Directory
Nature: ChildOf
Mapping: Discouraged
Type: Class
ID: 668
Name: Exposure of Resource to Wrong Sphere
Nature: ChildOf
Mapping: Discouraged
Type: Class
ID: 285
Name: Improper Authorization
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 527
Name: Exposure of Version-Control Repository to an Unauthorized Control Sphere
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 219
Name: Storage of File with Sensitive Data Under Web Root
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 220
Name: Storage of File With Sensitive Data Under FTP Root
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 528
Name: Exposure of Core Dump File to an Unauthorized Control Sphere
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 529
Name: Exposure of Access Control List Files to an Unauthorized Control Sphere
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 530
Name: Exposure of Backup File to an Unauthorized Control Sphere
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 539
Name: Use of Persistent Cookies Containing Sensitive Information
Nature: ParentOf
Mapping: Allowed
Type: Variant
ID: 553
Name: Command Shell in Externally Accessible Directory
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC731OWASP Top Ten 2004 Category A10 - Insecure Configuration Management
MemberOfProhibitedC743CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
MemberOfProhibitedC815OWASP Top Ten 2010 Category A6 - Security Misconfiguration
MemberOfProhibitedC877CERT C++ Secure Coding Section 09 - Input Output (FIO)
MemberOfProhibitedC963SFP Secondary Cluster: Exposed Data
MemberOfProhibitedC1011Authorize Actors
MemberOfProhibitedC1212Authorization Errors
MemberOfProhibitedC1345OWASP Top Ten 2021 Category A01:2021 - Broken Access Control
MemberOfProhibitedC1403Comprehensive Categorization: Exposed Resource
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 731
Name: OWASP Top Ten 2004 Category A10 - Insecure Configuration Management
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 743
Name: CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 815
Name: OWASP Top Ten 2010 Category A6 - Security Misconfiguration
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 877
Name: CERT C++ Secure Coding Section 09 - Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 963
Name: SFP Secondary Cluster: Exposed Data
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1011
Name: Authorize Actors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1212
Name: Authorization Errors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1345
Name: OWASP Top Ten 2021 Category A01:2021 - Broken Access Control
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1403
Name: Comprehensive Categorization: Exposed Resource
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-304Cloud Computing (technology class) Weaknesses
MemberOfProhibitedBSBOSS-307Not Technology-Specific (technology class) Weaknesses
MemberOfProhibitedBSBOSS-319Read Files or Directories (impact)
MemberOfProhibitedBSBOSS-320Modify Files or Directories (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-294
Name: Not Language-Specific Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-304
Name: Cloud Computing (technology class) Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-307
Name: Not Technology-Specific (technology class) Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-319
Name: Read Files or Directories (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-320
Name: Modify Files or Directories (impact)
▼Relevant To View
Relevant to the view"Architectural Concepts - (1008)"
NatureMappingTypeIDName
MemberOfProhibitedC1011Authorize Actors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1011
Name: Authorize Actors
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC1212Authorization Errors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1212
Name: Authorization Errors
Relevant to the view"OWASP Top Ten (2021) - (1344)"
NatureMappingTypeIDName
MemberOfProhibitedC1345OWASP Top Ten 2021 Category A01:2021 - Broken Access Control
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1345
Name: OWASP Top Ten 2021 Category A01:2021 - Broken Access Control
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC963SFP Secondary Cluster: Exposed Data
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 963
Name: SFP Secondary Cluster: Exposed Data
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
ConfidentialityIntegrityN/ARead Files or DirectoriesModify Files or Directories
N/A
Scope: Confidentiality, Integrity
Likelihood: N/A
Impact: Read Files or Directories, Modify Files or Directories
Note:
N/A
▼Potential Mitigations
Phase:Implementation, System Configuration, Operation
Mitigation ID:
Strategy:
Effectiveness:
Description:

When storing data in the cloud (e.g., S3 buckets, Azure blobs, Google Cloud Storage, etc.), use the provider's controls to disable public access.

Note:

▼Modes Of Introduction
Phase: Architecture and Design
Note:

N/A

Phase: Implementation
Note:

OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase.

Phase: Operation
Note:

OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase.

▼Applicable Platforms
Languages
Class: Not Language-Specific(Undetermined Prevalence)
Technology
Class: Not Technology-Specific(Undetermined Prevalence)
Class: Cloud Computing(Often Prevalence)
▼Demonstrative Examples
Example 1

The following Azure command updates the settings for a storage account:

Language: ( code)
N/A

Language: Shell(Bad code)
az storage account update --name <storage-account> --resource-group <resource-group> --allow-blob-public-access true

Language: ( code)
N/A

However, "Allow Blob Public Access" is set to true, meaning that anonymous/public users can access blobs.

Language: ( code)
N/A

The command could be modified to disable "Allow Blob Public Access" by setting it to false.

Language: Shell(Good code)
az storage account update --name <storage-account> --resource-group <resource-group> --allow-blob-public-access false

Example 2

The following Google Cloud Storage command gets the settings for a storage account named 'BUCKET_NAME':

Language: ( code)
N/A

Language: Shell(Informative code)
gsutil iam get gs://BUCKET_NAME

Language: ( code)
N/A

Suppose the command returns the following result:

Language: JSON(Bad code)
{ "bindings":[{ "members":[ "projectEditor: PROJECT-ID", "projectOwner: PROJECT-ID" ], "role":"roles/storage.legacyBucketOwner" }, { "members":[ "allUsers", "projectViewer: PROJECT-ID" ], "role":"roles/storage.legacyBucketReader" } ] }

Language: ( code)
N/A

This result includes the "allUsers" or IAM role added as members, causing this policy configuration to allow public access to cloud storage resources. There would be a similar concern if "allAuthenticatedUsers" was present.

Language: ( code)
N/A

The command could be modified to remove "allUsers" and/or "allAuthenticatedUsers" as follows:

Language: Shell(Good code)
gsutil iam ch -d allUsers gs://BUCKET_NAME gsutil iam ch -d allAuthenticatedUsers gs://BUCKET_NAME

▼Observed Examples
ReferenceDescription
CVE-2005-1835
Data file under web root.
Reference: CVE-2005-1835
Description:
Data file under web root.
▼Affected Resources
  • File or Directory
▼Functional Areas
    ▼Weakness Ordinalities
    OrdinalityDescription
    ▼Detection Methods
    Automated Static Analysis
    Detection Method ID:DM-14
    Description:

    Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

    Effectiveness:High
    Note:

    N/A

    ▼Vulnerability Mapping Notes
    Usage:Allowed
    Reason:Acceptable-Use
    Rationale:

    This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

    Comments:

    Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

    Suggestions:
    ▼Notes
    ▼Taxonomy Mappings
    Taxonomy NameEntry IDFitEntry Name
    OWASP Top Ten 2004A10CWE More SpecificInsecure Configuration Management
    CERT C Secure CodingFIO15-CN/AEnsure that file operations are performed in a secure directory
    Taxonomy Name: OWASP Top Ten 2004
    Entry ID: A10
    Fit: CWE More Specific
    Entry Name: Insecure Configuration Management
    Taxonomy Name: CERT C Secure Coding
    Entry ID: FIO15-C
    Fit: N/A
    Entry Name: Ensure that file operations are performed in a secure directory
    ▼Related Attack Patterns
    IDName
    CAPEC-150
    Collect Data from Common Resource Locations
    CAPEC-639
    Probe System Files
    ID: CAPEC-150
    Name: Collect Data from Common Resource Locations
    ID: CAPEC-639
    Name: Probe System Files
    ▼References
    Reference ID: REF-1307
    Title: CIS Microsoft Azure Foundations Benchmark version 1.5.0
    Author: Center for Internet Security
    Section: Section 3.7
    Publication:
    Publisher:
    Edition:
    URL:https://www.cisecurity.org/benchmark/azure
    URL Date:2023-01-19
    Day:16
    Month:08
    Year:2022
    Reference ID: REF-1327
    Title: CIS Google Cloud Computing Platform Benchmark version 1.3.0
    Author: Center for Internet Security
    Section: Section 5.1
    Publication:
    Publisher:
    Edition:
    URL:https://www.cisecurity.org/benchmark/google_cloud_computing_platform
    URL Date:2023-04-24
    Day:31
    Month:03
    Year:2022
    Details not found