.DS_Store file

  • CWE 425
  • WASC 34

Predictable Resource Location occurs when an application uses easily guessable or sequential identifiers for resources such as files, URLs, session IDs, or database entries. This allows attackers to enumerate, access, or manipulate sensitive resources without proper authorization. Commonly exploited in web applications, this vulnerability arises from using incremental IDs, predictable filenames, or simple naming conventions without implementing access control checks.

Common patterns leading to predictable resource locations:

  • Sequential or incremental file names (e.g., invoice1.pdf, invoice2.pdf) accessible via URLs.
  • Predictable API endpoints or URL paths.
  • Session identifiers or tokens generated in a predictable manner.
  • Lack of authorization checks for resource access, assuming obscurity is sufficient.

Impacts:

  • Unauthorized Access: Attackers can access confidential resources by guessing resource identifiers.
  • Information Disclosure: Sequential or predictable resources may expose sensitive data such as invoices, user profiles, or configuration files.
  • Privilege Escalation: Predictable endpoints or session IDs can be abused to gain higher-level access.
  • Facilitates Enumeration: Attackers can systematically enumerate available resources to identify vulnerabilities.

Detection indicators:

  • Resources accessible via URLs with incremental or predictable identifiers.
  • Absence of access control checks on resources.
  • Automated security scanners identifying sequential or guessable resource patterns.
Remediation

Mitigation focuses on making resource identifiers unpredictable and enforcing strict access control:

  1. Use Randomized Identifiers
    Implement GUIDs, UUIDs, or cryptographically secure random tokens for resource names and session IDs.

  2. Enforce Access Control Checks
    Do not rely solely on obscurity; verify that users have proper authorization to access any resource.

  3. Avoid Predictable Naming Patterns
    Do not use sequential numbering, timestamps, or simple naming schemes for sensitive resources.

  4. Limit Resource Exposure
    Restrict access to sensitive directories and files via authentication and authorization mechanisms.

  5. Secure API Design
    Validate that API endpoints enforce authentication and authorization regardless of identifier predictability.

  6. Monitor and Audit Resource Access
    Log and review access attempts to detect enumeration or unauthorized access.

  7. Regular Security Testing
    Include checks for predictable resource locations in penetration testing and automated scanning.

References