Security Notes
  • Whoami
  • Pentesting
    • WEP-Pen
      • Reconnaissance
      • Enumeration
      • OWSAP TOP 10
        • Injection
          • Cross Site Scripting
            • Cross Site Scripting
            • Exploitation
            • Protections
          • SQL Injection
            • SQL Injection Overview
          • NoSQL Injection
          • CRLF Injection
          • XML Injection
        • Broken Access Control
          • Path Traversal
          • Sensitive Cookie with Improper SameSite Attribute
          • Link Following
          • Incorrect Default Permissions
          • Information disclosure
          • CSRF
            • csrf checklist
          • 403 bypass
          • Exposure of WSDL File Containing Sensitive Information
          • bussiness logic checklist
          • 2FA bypass checklist
          • admin panal checklist
          • idor checklist
          • Authentication checklist
          • reset_password_checklist
          • ATO
        • Cryptographic Failures
          • Cryptographic Failure
          • Weak Encoding for Password
          • Improper Following of a Certificate's Chain of Trust
            • Understanding Digital Certificates : Self-Signed and CA-Signed Certificate **
            • Transport Layer Security (TLS) and SSL **
          • Clear Text Transmission Of Sensitive Data
            • SSLStripping **
        • Insecure Design
        • Security Misconfiguration
          • CORS Miscofigration
          • Mail Server Misconfiguration
        • Vulnerable and Outdated Components
          • Using Components with Known Vulnerabilities
        • Identification and Authentication Failures
          • JWT Hacking
          • SAML Authentication bypass
        • Software and Data Integrity Failures
          • mass assignment
          • PostMessage Vulnerabilities
            • PostMessage Vulnerabilities
            • Blocking main page to steal postmessage
            • Bypassing SOP with Iframes - part 1
            • Bypassing SOP with Iframes - part 2
            • Steal postmessage modifying iframe location
        • Security Logging and Monitoring Failures
        • Server-Side Request Forgery (SSRF)
          • SSRF
      • Checklists
        • aem misconfiguration
        • exif_geo
        • xss
        • Session Management
        • Authorization
        • cookie
        • Django
        • Symfony
        • json
        • bypass rate limit
        • Rce
        • Register Page
      • eWPTXv2 Preparation
        • Encoding & Filtering
        • Evasion Basics
        • Cross-site scripting (XSS)
        • XSS Filter Evasion
        • Cross-site request forgery (CSRF
        • HTML5
      • API-Pen
        • API Discovry
        • Reverse Engineering API Documentation
        • Excessive Data Exposure
        • Vulnerability Scanning
        • API Authentication Attacks
          • Classic Authentication Attacks
          • API Token Attacks
        • API Authorization Attacks
          • Broken Object Level Authorization (BOLA)
          • Broken Function Level Authorization
        • Improper Assets Management
        • Mass Assignment
        • SSRF
        • Injection Attacks in API
        • Evasive Maneuvers
        • GraphQL Vulnerabilities
    • NET-Pen
      • Active Directory Pentesting
        • Active Directory Components
        • Initial Attack Vectors
          • LLMNR Poisoning
          • SMB Relay Attacks
          • IPv6 Attacks ( IPv6 DNS Takeover )
          • Printer Hacking
          • Methodology
          • Some Other Attacks
            • Zerologon (CVE-2020-1472)
            • PrintNightmare (CVE-2021-1675)
        • Post-Compromise Attacks
          • Pass Attacks
          • Kerberoasting Attack
          • Token Impersonation Attack
          • LNK File Attack
          • GPP / cPassword Attacks
          • Mimikatz
          • Methodology
        • We've Compromised the Domain
          • Dumping the NTDS.dit
          • Golden Ticket Attacks
          • Methodology
        • Case Study
        • Password Attacks
      • Attack Vectors by Port
        • FTP 21
        • SSH 22
        • Telnet 23 - 2323
        • SMTP 25
        • DNS 53
        • Kerberos 88
        • POP 110-995
        • RPC 111
        • Ident 113
        • NNTP 119
        • NetBIOS 137-138
        • SMB / Samba 135-139, 445
        • MSRPC 135
        • SNMP 161
        • LDAP 389,636
        • Modbus 502
        • OpenSSL 1337
        • Ms-SQL 1433
        • Oracle Listener 1521 1522 1529
        • NFS 2049
        • MySql 3306
        • RDP 3389
        • ADB Android Debug Bridge 5555
        • WinRM 5985 5986
        • VNC 5800 5900
        • Redis 6379
        • Unreal IRC 6667
        • Tomcat 8080
        • MongoDB 27017
        • http 80
      • Network basics
      • Information Gathering
      • Privilege Escalation
        • Windows Privilege Escalation
        • Linux Privilege Escalation
    • write-ups
      • How i found a Privilege Escalation via Impersonation Features feature
      • How I was able to discover ATO Via IDOR vulnerability
      • Easy full Account Takeover via Facebook OAuth Misconfiguration
Powered by GitBook
On this page
  1. Pentesting
  2. WEP-Pen
  3. API-Pen

Excessive Data Exposure

Understanding API Responses

  • API providers may return complete data objects, relying on clients to filter necessary information.

  • The main concern is the sensitivity of the data sent, not just the quantity.

API Documentation Understanding API documentation is crucial for effective testing. Key sections typically include:

  • Overview:

    • Introduces the API and details authentication and rate limits.

    • Example: Financial APIs may impose strict rate limits to prevent abuse.

  • Functionality:

    • Lists actions using HTTP methods (GET, PUT, POST, DELETE) and endpoints.

    • Example: An endpoint should only return data for the authenticated user, avoiding sensitive information about others.

  • Request Requirements:

    • Specifies authentication, parameters, path variables, headers, and request body.

    • Example: Omission of necessary authentication headers can lead to unauthorized access to private user information.

API Documentation Conventions

Familiarity with common API documentation conventions helps in forming well-structured requests:

  • Path Variables: Indicated by a colon (:) or curly brackets ({}). Example: /user/:id or /user/{id}

  • Optional Input: Square brackets ([]) indicate optional inputs. Example: /api/v1/user?find=[name]

  • Multiple Values: Double bars (|) show alternative values. Example: "blue" | "green" | "red"

Using Postman for API Testing

  • Add valid tokens for authorized requests (e.g., Bearer Tokens) in collection settings.

  • Use the variables tab in Postman to set placeholders for values like the baseUrl, tokens, and other reusable elements.

  • Switch HTTP methods easily within Postman.

Testing for Excessive Data Exposure

1. Authenticate:

  • Send a POST request to the API’s authentication endpoint with valid credentials (e.g., username and password) to get your token.

  • Example Response:

    {"token": "Bearer <token>"}

2. Configure Authorization:

  • Add the Bearer Token to the Authorization section in Postman to ensure your requests are authorized.

  • Save this configuration for consistency when making multiple requests.

3. Check Response Size:

  • Monitor response sizes when requesting resources, such as user profile or dashboard information.

  • Example Response:

    jsonCopy code{
      "id": "123",
      "name": "User",
      "email": "user@example.com",
      "additionalInfo": {
        "emails": ["user1@example.com", "user2@example.com"],
        "privilege": "admin",
        "MFA": false
      }
    }

4. Identify Excessive Data:

  • Ingredients: Responses may include more data than necessary, such as personal details or sensitive information about other users.

  • Example: Request:

    httpCopy codeGET /api/v1/user?=CloudStrife

    Response:

    jsonCopy code{
      "id": "123",
      "name": "Cloud",
      "email": "cloud@example.com",
      "privilege": "user",
      "representative": {
        "name": "Don Corneo",
        "id": "2203",
        "email": "dcorn@example.com",
        "privilege": "admin",
        "MFA": false
      }
    }

    In this case, the response reveals not only the requested user's information but also sensitive details about an admin, which should not be exposed.

Practical Tips for Testing Excessive Data Exposure

  • Review Response Data: Look for unnecessary or sensitive information in responses.

  • Test Edge Cases: Use invalid or unexpected parameters to see if sensitive data leaks.

  • Monitor API Behavior: Log and analyze API behavior over time for exposure patterns.

  • Role-Based Testing: Validate data returned for different user roles to ensure proper access control.

PreviousReverse Engineering API DocumentationNextVulnerability Scanning

Last updated 6 months ago