[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B9F2CKD96G12FQ12SY5RW1":3,"skill-same:01M7B9F2CKD96G12FQ12SY5RW1":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":13,"repositoryHtmlUrl":57,"repositoryHomepageUrl":6,"ownerHtmlUrl":58,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":59,"install":60,"resources":73},"01M7B9F2CKD96G12FQ12SY5RW1","testing-for-sensitive-data-exposure",null,"Identifying sensitive data exposure vulnerabilities including API key leakage, PII in responses, insecure storage, and unprotected data transmission during security assessments.","vikasvardhanv\u002Fjerry_skills","vikasvardhanv","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99010657?v=4","01M7B2B0VN78W7529RQX5BR6DZ","01M7B2B0WDNTXJHRK3QNPNWRP6",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Ftesting-for-sensitive-data-exposure\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Ftesting-for-sensitive-data-exposure\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: testing-for-sensitive-data-exposure\ndescription: Identifying sensitive data exposure vulnerabilities including API key\n  leakage, PII in responses, insecure storage, and unprotected data transmission during\n  security assessments.\ndomain: cybersecurity\nsubdomain: web-application-security\ntags:\n- penetration-testing\n- data-exposure\n- pii\n- owasp\n- web-security\n- api-keys\n- secrets\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_ai_rmf:\n- MEASURE-2.7\n- MAP-5.1\n- MANAGE-2.4\natlas_techniques:\n- AML.T0070\n- AML.T0066\n- AML.T0082\nnist_csf:\n- PR.PS-01\n- ID.RA-01\n- PR.DS-10\n- DE.CM-01\nmitre_attack:\n- T1190\n- T1059.007\n- T1505.003\n- T1083\n---\n\n# Testing for Sensitive Data Exposure\n\n## When to Use\n\n- During authorized penetration tests when assessing data protection controls\n- When evaluating applications for GDPR, PCI DSS, HIPAA, or other data protection compliance\n- For identifying leaked API keys, credentials, tokens, and secrets in application responses\n- When testing whether sensitive data is properly encrypted in transit and at rest\n- During security assessments of APIs that handle PII, financial data, or health records\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement with data handling scope\n- **Burp Suite Professional**: For intercepting and analyzing responses for sensitive data\n- **trufflehog**: Secret scanning tool (`pip install trufflehog`)\n- **gitleaks**: Git repository secret scanner (`go install github.com\u002Fgitleaks\u002Fgitleaks\u002Fv8@latest`)\n- **curl\u002Fhttpie**: For manual endpoint testing\n- **Browser DevTools**: For examining local storage, session storage, and cached data\n- **testssl.sh**: TLS configuration testing tool\n\n## Workflow\n\n### Step 1: Scan for Secrets in Client-Side Code\n\nSearch JavaScript files, HTML source, and other client-side resources for exposed secrets.\n\n```bash\n# Download and search JavaScript files for secrets\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | \\\n  grep -oP 'src=\"[^\"]*\\.js[^\"]*\"' | \\\n  grep -oP '\"[^\"]*\"' | tr -d '\"' | while read js; do\n    echo \"=== Scanning: $js ===\"\n    # Handle relative URLs\n    if [[ \"$js\" == \u002F* ]]; then\n      curl -s \"https:\u002F\u002Ftarget.example.com$js\"\n    else\n      curl -s \"$js\"\n    fi | grep -inE \\\n      \"(api[_-]?key|apikey|api[_-]?secret|aws[_-]?access|aws[_-]?secret|private[_-]?key|password|secret|token|auth|credential|AKIA[0-9A-Z]{16})\" \\\n      | head -20\ndone\n\n# Search for common secret patterns\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fstatic\u002Fapp.js\" | grep -nP \\\n  \"(AIza[0-9A-Za-z-_]{35}|AKIA[0-9A-Z]{16}|sk-[a-zA-Z0-9]{48}|ghp_[a-zA-Z0-9]{36}|xox[bpsa]-[0-9a-zA-Z-]{10,})\"\n\n# Check source maps for exposed source code\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fstatic\u002Fapp.js.map\" | head -c 500\n# Source maps may contain original source code with embedded secrets\n\n# Search HTML source for exposed data\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -inE \\\n  \"(api_key|secret|password|token|private_key|database_url|smtp_password)\" | head -20\n\n# Check for exposed .env or configuration files\nfor file in .env .env.local .env.production config.json settings.json \\\n  .aws\u002Fcredentials .docker\u002Fconfig.json; do\n  status=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \\\n    \"https:\u002F\u002Ftarget.example.com\u002F$file\")\n  if [ \"$status\" == \"200\" ]; then\n    echo \"FOUND: $file ($status)\"\n  fi\ndone\n```\n\n### Step 2: Analyze API Responses for Data Over-Exposure\n\nCheck if API endpoints return more data than necessary.\n\n```bash\n# Fetch user profile and examine response fields\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002Fme\" | jq .\n\n# Look for sensitive fields that should not be exposed:\n# - password, password_hash, password_salt\n# - ssn, social_security_number, national_id\n# - credit_card_number, card_cvv, card_expiry\n# - api_key, secret_key, access_token, refresh_token\n# - internal_id, database_id\n# - ip_address, session_id\n# - date_of_birth, drivers_license\n\n# Check list endpoints for excessive data\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\" | jq '.[0] | keys'\n\n# Compare public vs authenticated responses\necho \"=== Public ===\"\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002F1\" | jq 'keys'\necho \"=== Authenticated ===\"\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002F1\" | jq 'keys'\n\n# Check error responses for information leakage\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invalid\": \"data\"}' \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\" | jq .\n# Look for: stack traces, database queries, internal paths, version info\n\n# Test for PII in search\u002Fautocomplete responses\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fsearch?q=john\" | jq .\n# May return full user records instead of just names\n```\n\n### Step 3: Test Data Transmission Security\n\nVerify that sensitive data is encrypted during transmission.\n\n```bash\n# Check TLS configuration\n# Using testssl.sh\n.\u002Ftestssl.sh \"https:\u002F\u002Ftarget.example.com\"\n\n# Quick TLS checks with curl\ncurl -s -v \"https:\u002F\u002Ftarget.example.com\u002F\" 2>&1 | grep -E \"(SSL|TLS|cipher|subject)\"\n\n# Check for HTTP (non-HTTPS) endpoints\ncurl -s -I \"http:\u002F\u002Ftarget.example.com\u002F\" | head -5\n# Should redirect to HTTPS\n\n# Check for mixed content (HTTP resources on HTTPS pages)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -oP \"http:\u002F\u002F[^\\\"'> ]+\" | head -20\n\n# Check if sensitive forms submit over HTTPS\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Flogin\" | grep -oP 'action=\"[^\"]*\"'\n# Form action should use HTTPS\n\n# Check for sensitive data in URL parameters (query string)\n# URLs are logged in browser history, server logs, proxy logs, Referer headers\n# Look for: \u002Flogin?username=admin&password=secret\n# \u002Fapi\u002Fdata?ssn=123-45-6789\n# \u002Fsearch?credit_card=4111111111111111\n\n# Check WebSocket encryption\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -oP \"(ws|wss):\u002F\u002F[^\\\"'> ]+\"\n# ws:\u002F\u002F is unencrypted; should only use wss:\u002F\u002F\n```\n\n### Step 4: Examine Browser Storage for Sensitive Data\n\nCheck local storage, session storage, cookies, and cached responses.\n\n```bash\n# Check what cookies are set and their security attributes\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002Flogin\" | grep -i \"set-cookie\"\n\n# In browser DevTools (Application tab):\n# 1. Local Storage: Check for stored tokens, PII, credentials\n# 2. Session Storage: Check for temporary sensitive data\n# 3. IndexedDB: Check for cached application data\n# 4. Cache Storage: Check for cached API responses containing PII\n# 5. Cookies: Check for sensitive data in cookie values\n\n# Common insecure storage patterns:\n# localStorage.setItem('access_token', 'eyJ...');  \u002F\u002F XSS can steal\n# localStorage.setItem('user', JSON.stringify({email: '...', ssn: '...'}));\n# sessionStorage.setItem('credit_card', '4111...');\n\n# Check for autocomplete on sensitive forms\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Flogin\" | \\\n  grep -oP '\u003Cinput[^>]*(password|credit|ssn|card)[^>]*>' | \\\n  grep -v 'autocomplete=\"off\"'\n# Password and credit card fields should have autocomplete=\"off\"\n\n# Check Cache-Control headers on sensitive pages\nfor page in \u002Faccount\u002Fprofile \u002Fapi\u002Fusers\u002Fme \u002Ftransactions \u002Fbilling; do\n  echo -n \"$page: \"\n  curl -s -I \"https:\u002F\u002Ftarget.example.com$page\" \\\n    -H \"Authorization: Bearer $TOKEN\" | \\\n    grep -i \"cache-control\" | tr -d '\\r'\n  echo\ndone\n# Sensitive pages should have: Cache-Control: no-store\n```\n\n### Step 5: Scan Git Repositories and Source Code for Secrets\n\nSearch for accidentally committed secrets in version control.\n\n```bash\n# Check for exposed .git directory\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F.git\u002Fconfig\"\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F.git\u002FHEAD\"\n\n# If .git is exposed, use git-dumper to download\n# pip install git-dumper\ngit-dumper https:\u002F\u002Ftarget.example.com\u002F.git \u002Ftmp\u002Ftarget-repo\n\n# Scan downloaded repository with trufflehog\ntrufflehog filesystem \u002Ftmp\u002Ftarget-repo\n\n# Scan with gitleaks\ngitleaks detect --source \u002Ftmp\u002Ftarget-repo -v\n\n# If GitHub\u002FGitLab repository is available (authorized scope)\ntrufflehog github --org target-organization --token $GITHUB_TOKEN\ngitleaks detect --source https:\u002F\u002Fgithub.com\u002Forg\u002Frepo -v\n\n# Common secrets found in repositories:\n# - AWS access keys (AKIA...)\n# - Database connection strings\n# - API keys (Google, Stripe, Twilio, SendGrid)\n# - Private SSH keys\n# - JWT signing secrets\n# - OAuth client secrets\n# - SMTP credentials\n\n# Search for secrets in Docker images\n# docker save target-image:latest | tar x -C \u002Ftmp\u002Fdocker-layers\n# Search each layer for credentials\n```\n\n### Step 6: Test Data Masking and Redaction\n\nVerify that sensitive data is properly masked in the application.\n\n```bash\n# Check if credit card numbers are fully displayed\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fpayment-methods\" | jq .\n# Should show: **** **** **** 4242, not full number\n\n# Check if SSN\u002Fnational ID is masked\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002Fme\" | jq '.ssn'\n# Should show: ***-**-6789, not full SSN\n\n# Check API responses for password hashes\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\" | jq '.[].password \u002F\u002F empty'\n# Should return nothing; password hashes should never be in API responses\n\n# Check export\u002Fdownload features for unmasked data\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002Fexport?format=csv\" | head -5\n# CSV exports often contain unmasked PII\n\n# Check logging endpoints for sensitive data\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fadmin\u002Flogs\" | \\\n  grep -iE \"(password|token|secret|credit_card|ssn)\" | head -10\n# Logs should not contain sensitive data in plaintext\n\n# Test for sensitive data in error messages\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"email\":\"duplicate@test.com\"}' \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fregister\"\n# Should not reveal: \"User with email duplicate@test.com already exists\"\n# Should show: \"Registration failed\" (generic)\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Sensitive Data Exposure** | Unintended disclosure of PII, credentials, financial data, or health records |\n| **Data Over-Exposure** | API returning more data fields than the client needs |\n| **Secret Leakage** | API keys, tokens, or credentials exposed in client-side code or logs |\n| **Data at Rest** | Sensitive data stored in databases, files, or backups without encryption |\n| **Data in Transit** | Sensitive data transmitted over network without TLS encryption |\n| **Data Masking** | Replacing sensitive data with redacted values (e.g., showing last 4 digits of credit card) |\n| **PII** | Personally Identifiable Information - data that can identify an individual |\n| **Information Leakage** | Excessive error messages, stack traces, or debug information in responses |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **Burp Suite Professional** | Response analysis and regex-based sensitive data scanning |\n| **trufflehog** | Secret detection across git repos, filesystems, and cloud storage |\n| **gitleaks** | Git repository scanning for hardcoded secrets |\n| **testssl.sh** | TLS\u002FSSL configuration assessment |\n| **git-dumper** | Downloading exposed .git directories from web servers |\n| **SecretFinder** | JavaScript file analysis for exposed API keys and tokens |\n| **Retire.js** | Detecting JavaScript libraries with known vulnerabilities |\n\n## Common Scenarios\n\n### Scenario 1: API Key in JavaScript Bundle\nThe application's JavaScript bundle contains a hardcoded Google Maps API key and a Stripe publishable key. The Stripe key has overly broad permissions, allowing the attacker to create charges.\n\n### Scenario 2: User API Returns Password Hashes\nThe `\u002Fapi\u002Fusers` endpoint returns complete user objects including bcrypt password hashes. Attackers can extract hashes and attempt offline cracking.\n\n### Scenario 3: PII in Cached API Responses\nThe user profile API endpoint returns full SSN and credit card numbers without masking. The endpoint does not set `Cache-Control: no-store`, so responses are cached in the browser and proxy caches.\n\n### Scenario 4: Git Repository with Database Credentials\nThe `.git` directory is accessible on the production server. Using git-dumper, the attacker downloads the repository history, finding database credentials committed in an early commit that were later \"removed\" but remain in git history.\n\n## Output Format\n\n```\n## Sensitive Data Exposure Assessment Report\n\n**Target**: target.example.com\n**Assessment Date**: 2024-01-15\n**OWASP Category**: A02:2021 - Cryptographic Failures\n\n### Findings Summary\n| Finding | Severity | Data Type |\n|---------|----------|-----------|\n| API keys in JavaScript source | High | Credentials |\n| Password hashes in API response | Critical | Authentication |\n| Unmasked SSN in user profile | Critical | PII |\n| Credit card number in export | High | Financial |\n| .git directory exposed | Critical | Source code + secrets |\n| Missing TLS on API endpoint | High | All data in transit |\n| Sensitive data in error messages | Medium | Technical info |\n\n### Critical: Exposed Secrets\n| Secret Type | Location | Risk |\n|-------------|----------|------|\n| AWS Access Key (AKIA...) | \u002Fstatic\u002Fapp.js line 342 | AWS resource access |\n| Stripe Secret Key (sk_live_...) | .env (via .git exposure) | Payment processing |\n| Database URL with credentials | .git history commit abc123 | Database access |\n| JWT Signing Secret | config.json (via .git) | Token forgery |\n\n### Data Over-Exposure in APIs\n| Endpoint | Unnecessary Fields Returned |\n|----------|-----------------------------|\n| GET \u002Fapi\u002Fusers | password_hash, internal_id, created_ip |\n| GET \u002Fapi\u002Fusers\u002F{id} | ssn, credit_card_full, date_of_birth |\n| GET \u002Fapi\u002Forders | customer_phone, customer_address |\n\n### Recommendation\n1. Remove all hardcoded secrets from client-side code; use backend proxies\n2. Rotate all exposed credentials immediately\n3. Remove .git directory from production web root\n4. Implement response field filtering; return only required fields\n5. Mask sensitive data (SSN, credit card) in all API responses\n6. Add Cache-Control: no-store to all sensitive endpoints\n7. Enable TLS 1.2+ on all endpoints; redirect HTTP to HTTPS\n8. Implement secret scanning in CI\u002FCD pipeline (trufflehog\u002Fgitleaks)\n```\n","# Testing for Sensitive Data Exposure\n\n## When to Use\n\n- During authorized penetration tests when assessing data protection controls\n- When evaluating applications for GDPR, PCI DSS, HIPAA, or other data protection compliance\n- For identifying leaked API keys, credentials, tokens, and secrets in application responses\n- When testing whether sensitive data is properly encrypted in transit and at rest\n- During security assessments of APIs that handle PII, financial data, or health records\n\n## Prerequisites\n\n- **Authorization**: Written penetration testing agreement with data handling scope\n- **Burp Suite Professional**: For intercepting and analyzing responses for sensitive data\n- **trufflehog**: Secret scanning tool (`pip install trufflehog`)\n- **gitleaks**: Git repository secret scanner (`go install github.com\u002Fgitleaks\u002Fgitleaks\u002Fv8@latest`)\n- **curl\u002Fhttpie**: For manual endpoint testing\n- **Browser DevTools**: For examining local storage, session storage, and cached data\n- **testssl.sh**: TLS configuration testing tool\n\n## Workflow\n\n### Step 1: Scan for Secrets in Client-Side Code\n\nSearch JavaScript files, HTML source, and other client-side resources for exposed secrets.\n\n```bash\n# Download and search JavaScript files for secrets\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | \\\n  grep -oP 'src=\"[^\"]*\\.js[^\"]*\"' | \\\n  grep -oP '\"[^\"]*\"' | tr -d '\"' | while read js; do\n    echo \"=== Scanning: $js ===\"\n    # Handle relative URLs\n    if [[ \"$js\" == \u002F* ]]; then\n      curl -s \"https:\u002F\u002Ftarget.example.com$js\"\n    else\n      curl -s \"$js\"\n    fi | grep -inE \\\n      \"(api[_-]?key|apikey|api[_-]?secret|aws[_-]?access|aws[_-]?secret|private[_-]?key|password|secret|token|auth|credential|AKIA[0-9A-Z]{16})\" \\\n      | head -20\ndone\n\n# Search for common secret patterns\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fstatic\u002Fapp.js\" | grep -nP \\\n  \"(AIza[0-9A-Za-z-_]{35}|AKIA[0-9A-Z]{16}|sk-[a-zA-Z0-9]{48}|ghp_[a-zA-Z0-9]{36}|xox[bpsa]-[0-9a-zA-Z-]{10,})\"\n\n# Check source maps for exposed source code\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fstatic\u002Fapp.js.map\" | head -c 500\n# Source maps may contain original source code with embedded secrets\n\n# Search HTML source for exposed data\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -inE \\\n  \"(api_key|secret|password|token|private_key|database_url|smtp_password)\" | head -20\n\n# Check for exposed .env or configuration files\nfor file in .env .env.local .env.production config.json settings.json \\\n  .aws\u002Fcredentials .docker\u002Fconfig.json; do\n  status=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" \\\n    \"https:\u002F\u002Ftarget.example.com\u002F$file\")\n  if [ \"$status\" == \"200\" ]; then\n    echo \"FOUND: $file ($status)\"\n  fi\ndone\n```\n\n### Step 2: Analyze API Responses for Data Over-Exposure\n\nCheck if API endpoints return more data than necessary.\n\n```bash\n# Fetch user profile and examine response fields\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002Fme\" | jq .\n\n# Look for sensitive fields that should not be exposed:\n# - password, password_hash, password_salt\n# - ssn, social_security_number, national_id\n# - credit_card_number, card_cvv, card_expiry\n# - api_key, secret_key, access_token, refresh_token\n# - internal_id, database_id\n# - ip_address, session_id\n# - date_of_birth, drivers_license\n\n# Check list endpoints for excessive data\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\" | jq '.[0] | keys'\n\n# Compare public vs authenticated responses\necho \"=== Public ===\"\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002F1\" | jq 'keys'\necho \"=== Authenticated ===\"\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002F1\" | jq 'keys'\n\n# Check error responses for information leakage\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"invalid\": \"data\"}' \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\" | jq .\n# Look for: stack traces, database queries, internal paths, version info\n\n# Test for PII in search\u002Fautocomplete responses\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fsearch?q=john\" | jq .\n# May return full user records instead of just names\n```\n\n### Step 3: Test Data Transmission Security\n\nVerify that sensitive data is encrypted during transmission.\n\n```bash\n# Check TLS configuration\n# Using testssl.sh\n.\u002Ftestssl.sh \"https:\u002F\u002Ftarget.example.com\"\n\n# Quick TLS checks with curl\ncurl -s -v \"https:\u002F\u002Ftarget.example.com\u002F\" 2>&1 | grep -E \"(SSL|TLS|cipher|subject)\"\n\n# Check for HTTP (non-HTTPS) endpoints\ncurl -s -I \"http:\u002F\u002Ftarget.example.com\u002F\" | head -5\n# Should redirect to HTTPS\n\n# Check for mixed content (HTTP resources on HTTPS pages)\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -oP \"http:\u002F\u002F[^\\\"'> ]+\" | head -20\n\n# Check if sensitive forms submit over HTTPS\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Flogin\" | grep -oP 'action=\"[^\"]*\"'\n# Form action should use HTTPS\n\n# Check for sensitive data in URL parameters (query string)\n# URLs are logged in browser history, server logs, proxy logs, Referer headers\n# Look for: \u002Flogin?username=admin&password=secret\n# \u002Fapi\u002Fdata?ssn=123-45-6789\n# \u002Fsearch?credit_card=4111111111111111\n\n# Check WebSocket encryption\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F\" | grep -oP \"(ws|wss):\u002F\u002F[^\\\"'> ]+\"\n# ws:\u002F\u002F is unencrypted; should only use wss:\u002F\u002F\n```\n\n### Step 4: Examine Browser Storage for Sensitive Data\n\nCheck local storage, session storage, cookies, and cached responses.\n\n```bash\n# Check what cookies are set and their security attributes\ncurl -s -I \"https:\u002F\u002Ftarget.example.com\u002Flogin\" | grep -i \"set-cookie\"\n\n# In browser DevTools (Application tab):\n# 1. Local Storage: Check for stored tokens, PII, credentials\n# 2. Session Storage: Check for temporary sensitive data\n# 3. IndexedDB: Check for cached application data\n# 4. Cache Storage: Check for cached API responses containing PII\n# 5. Cookies: Check for sensitive data in cookie values\n\n# Common insecure storage patterns:\n# localStorage.setItem('access_token', 'eyJ...');  \u002F\u002F XSS can steal\n# localStorage.setItem('user', JSON.stringify({email: '...', ssn: '...'}));\n# sessionStorage.setItem('credit_card', '4111...');\n\n# Check for autocomplete on sensitive forms\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002Flogin\" | \\\n  grep -oP '\u003Cinput[^>]*(password|credit|ssn|card)[^>]*>' | \\\n  grep -v 'autocomplete=\"off\"'\n# Password and credit card fields should have autocomplete=\"off\"\n\n# Check Cache-Control headers on sensitive pages\nfor page in \u002Faccount\u002Fprofile \u002Fapi\u002Fusers\u002Fme \u002Ftransactions \u002Fbilling; do\n  echo -n \"$page: \"\n  curl -s -I \"https:\u002F\u002Ftarget.example.com$page\" \\\n    -H \"Authorization: Bearer $TOKEN\" | \\\n    grep -i \"cache-control\" | tr -d '\\r'\n  echo\ndone\n# Sensitive pages should have: Cache-Control: no-store\n```\n\n### Step 5: Scan Git Repositories and Source Code for Secrets\n\nSearch for accidentally committed secrets in version control.\n\n```bash\n# Check for exposed .git directory\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F.git\u002Fconfig\"\ncurl -s \"https:\u002F\u002Ftarget.example.com\u002F.git\u002FHEAD\"\n\n# If .git is exposed, use git-dumper to download\n# pip install git-dumper\ngit-dumper https:\u002F\u002Ftarget.example.com\u002F.git \u002Ftmp\u002Ftarget-repo\n\n# Scan downloaded repository with trufflehog\ntrufflehog filesystem \u002Ftmp\u002Ftarget-repo\n\n# Scan with gitleaks\ngitleaks detect --source \u002Ftmp\u002Ftarget-repo -v\n\n# If GitHub\u002FGitLab repository is available (authorized scope)\ntrufflehog github --org target-organization --token $GITHUB_TOKEN\ngitleaks detect --source https:\u002F\u002Fgithub.com\u002Forg\u002Frepo -v\n\n# Common secrets found in repositories:\n# - AWS access keys (AKIA...)\n# - Database connection strings\n# - API keys (Google, Stripe, Twilio, SendGrid)\n# - Private SSH keys\n# - JWT signing secrets\n# - OAuth client secrets\n# - SMTP credentials\n\n# Search for secrets in Docker images\n# docker save target-image:latest | tar x -C \u002Ftmp\u002Fdocker-layers\n# Search each layer for credentials\n```\n\n### Step 6: Test Data Masking and Redaction\n\nVerify that sensitive data is properly masked in the application.\n\n```bash\n# Check if credit card numbers are fully displayed\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fpayment-methods\" | jq .\n# Should show: **** **** **** 4242, not full number\n\n# Check if SSN\u002Fnational ID is masked\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002Fme\" | jq '.ssn'\n# Should show: ***-**-6789, not full SSN\n\n# Check API responses for password hashes\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\" | jq '.[].password \u002F\u002F empty'\n# Should return nothing; password hashes should never be in API responses\n\n# Check export\u002Fdownload features for unmasked data\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fusers\u002Fexport?format=csv\" | head -5\n# CSV exports often contain unmasked PII\n\n# Check logging endpoints for sensitive data\ncurl -s -H \"Authorization: Bearer $TOKEN\" \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fadmin\u002Flogs\" | \\\n  grep -iE \"(password|token|secret|credit_card|ssn)\" | head -10\n# Logs should not contain sensitive data in plaintext\n\n# Test for sensitive data in error messages\ncurl -s -X POST \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"email\":\"duplicate@test.com\"}' \\\n  \"https:\u002F\u002Ftarget.example.com\u002Fapi\u002Fregister\"\n# Should not reveal: \"User with email duplicate@test.com already exists\"\n# Should show: \"Registration failed\" (generic)\n```\n\n## Key Concepts\n\n| Concept | Description |\n|---------|-------------|\n| **Sensitive Data Exposure** | Unintended disclosure of PII, credentials, financial data, or health records |\n| **Data Over-Exposure** | API returning more data fields than the client needs |\n| **Secret Leakage** | API keys, tokens, or credentials exposed in client-side code or logs |\n| **Data at Rest** | Sensitive data stored in databases, files, or backups without encryption |\n| **Data in Transit** | Sensitive data transmitted over network without TLS encryption |\n| **Data Masking** | Replacing sensitive data with redacted values (e.g., showing last 4 digits of credit card) |\n| **PII** | Personally Identifiable Information - data that can identify an individual |\n| **Information Leakage** | Excessive error messages, stack traces, or debug information in responses |\n\n## Tools & Systems\n\n| Tool | Purpose |\n|------|---------|\n| **Burp Suite Professional** | Response analysis and regex-based sensitive data scanning |\n| **trufflehog** | Secret detection across git repos, filesystems, and cloud storage |\n| **gitleaks** | Git repository scanning for hardcoded secrets |\n| **testssl.sh** | TLS\u002FSSL configuration assessment |\n| **git-dumper** | Downloading exposed .git directories from web servers |\n| **SecretFinder** | JavaScript file analysis for exposed API keys and tokens |\n| **Retire.js** | Detecting JavaScript libraries with known vulnerabilities |\n\n## Common Scenarios\n\n### Scenario 1: API Key in JavaScript Bundle\nThe application's JavaScript bundle contains a hardcoded Google Maps API key and a Stripe publishable key. The Stripe key has overly broad permissions, allowing the attacker to create charges.\n\n### Scenario 2: User API Returns Password Hashes\nThe `\u002Fapi\u002Fusers` endpoint returns complete user objects including bcrypt password hashes. Attackers can extract hashes and attempt offline cracking.\n\n### Scenario 3: PII in Cached API Responses\nThe user profile API endpoint returns full SSN and credit card numbers without masking. The endpoint does not set `Cache-Control: no-store`, so responses are cached in the browser and proxy caches.\n\n### Scenario 4: Git Repository with Database Credentials\nThe `.git` directory is accessible on the production server. Using git-dumper, the attacker downloads the repository history, finding database credentials committed in an early commit that were later \"removed\" but remain in git history.\n\n## Output Format\n\n```\n## Sensitive Data Exposure Assessment Report\n\n**Target**: target.example.com\n**Assessment Date**: 2024-01-15\n**OWASP Category**: A02:2021 - Cryptographic Failures\n\n### Findings Summary\n| Finding | Severity | Data Type |\n|---------|----------|-----------|\n| API keys in JavaScript source | High | Credentials |\n| Password hashes in API response | Critical | Authentication |\n| Unmasked SSN in user profile | Critical | PII |\n| Credit card number in export | High | Financial |\n| .git directory exposed | Critical | Source code + secrets |\n| Missing TLS on API endpoint | High | All data in transit |\n| Sensitive data in error messages | Medium | Technical info |\n\n### Critical: Exposed Secrets\n| Secret Type | Location | Risk |\n|-------------|----------|------|\n| AWS Access Key (AKIA...) | \u002Fstatic\u002Fapp.js line 342 | AWS resource access |\n| Stripe Secret Key (sk_live_...) | .env (via .git exposure) | Payment processing |\n| Database URL with credentials | .git history commit abc123 | Database access |\n| JWT Signing Secret | config.json (via .git) | Token forgery |\n\n### Data Over-Exposure in APIs\n| Endpoint | Unnecessary Fields Returned |\n|----------|-----------------------------|\n| GET \u002Fapi\u002Fusers | password_hash, internal_id, created_ip |\n| GET \u002Fapi\u002Fusers\u002F{id} | ssn, credit_card_full, date_of_birth |\n| GET \u002Fapi\u002Forders | customer_phone, customer_address |\n\n### Recommendation\n1. Remove all hardcoded secrets from client-side code; use backend proxies\n2. Rotate all exposed credentials immediately\n3. Remove .git directory from production web root\n4. Implement response field filtering; return only required fields\n5. Mask sensitive data (SSN, credit card) in all API responses\n6. Add Cache-Control: no-store to all sensitive endpoints\n7. Enable TLS 1.2+ on all endpoints; redirect HTTP to HTTPS\n8. Implement secret scanning in CI\u002FCD pipeline (trufflehog\u002Fgitleaks)\n```\n",{"name":5,"tags":24,"author":32,"domain":33,"license":14,"version":34,"nist_csf":35,"subdomain":40,"description":7,"nist_ai_rmf":41,"mitre_attack":45,"atlas_techniques":50},[25,26,27,28,29,30,31],"penetration-testing","data-exposure","pii","owasp","web-security","api-keys","secrets","mahipal","cybersecurity","1.0",[36,37,38,39],"PR.PS-01","ID.RA-01","PR.DS-10","DE.CM-01","web-application-security",[42,43,44],"MEASURE-2.7","MAP-5.1","MANAGE-2.4",[46,47,48,49],"T1190","T1059.007","T1505.003","T1083",[51,52,53],"AML.T0070","AML.T0066","AML.T0082","main","1eb986d0b0ecc180291597e08eb5a58288843536","skills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Ftesting-for-sensitive-data-exposure","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv","2026-08-25 13:16:33",{"source":8,"skillName":5,"commands":61,"prompt":71,"zipAvailable":72},[62,65,68],{"tool":63,"command":64},"npx","npx skills add vikasvardhanv\u002Fjerry_skills --skill testing-for-sensitive-data-exposure",{"tool":66,"command":67},"bunx","bunx skills add vikasvardhanv\u002Fjerry_skills --skill testing-for-sensitive-data-exposure",{"tool":69,"command":70},"pnpm","pnpm dlx skills add vikasvardhanv\u002Fjerry_skills --skill testing-for-sensitive-data-exposure","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Ftesting-for-sensitive-data-exposure\u002FSKILL.md",true,[74,78,84],{"path":75,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":15},"LICENSE","许可证",11255,{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"references\u002Fapi-reference.md","REFERENCE","参考文档",1740,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Ftesting-for-sensitive-data-exposure\u002Freferences\u002Fapi-reference.md",{"path":85,"resourceType":86,"resourceTypeDesc":87,"sizeBytes":88,"sourceHtmlUrl":89},"scripts\u002Fagent.py","SCRIPT","脚本",9726,"https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fcurated_premium_skills\u002FAnthropic-Cybersecurity-Skills\u002Fskills\u002Ftesting-for-sensitive-data-exposure\u002Fscripts\u002Fagent.py",[91,99,106,113,120,127],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7BESR1CJ3H5SP9XM8KYJZ9W","syllabus","Generates a curated supplementary reading list from any course syllabus using Consensus academic search. Grill-me intake (syllabus input format + course audience + year range) plus a grouping forcing-options checkpoint before any search runs — so the reading list matches the course's level and recency need. Parses the syllabus to extract topics and learning outcomes, searches Consensus for recent peer-reviewed papers per topic, and produces a professionally formatted .docx with clickable Consensus links, plain-language summaries calibrated to audience level, and Bloom-higher-order discussion questions tied to course learning goals. Use when the user uploads a syllabus, course outline, or curriculum document and wants supplementary readings (e.g., 'create a reading list from this syllabus', 'find recent papers for my course') — even casual mentions with a syllabus attached should trigger this skill.","MIT","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fsyllabus\u002Fskills\u002Fsyllabus\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M7BES1YA6R97W7QPMFFM1PED","pulse","Multi-source recency research skill that takes the pulse of any topic across Reddit, Hacker News, the open web, and optionally X\u002FTwitter within a configurable recent window (default 30 days). Forcing intake clarifies topic specificity, angle (trend\u002Fsentiment\u002Fproblems\u002Fopportunities\u002Fcomparison), time window, and platform scope before searching. Returns a synthesized briefing with citations, engagement metrics, and cross-platform pattern analysis. Use when the user requests multi-source recency intelligence on a topic (e.g., 'pulse on [topic]', 'what's happening with [topic]', 'what are people saying about [topic]', 'current conversation about [topic]', 'take the pulse of [topic]', 'trending: [topic]', 'find me info on [topic]'), and for competitor research, trend discovery, tool comparisons, and audience sentiment analysis.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpulse\u002Fskills\u002Fpulse\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M7BERNHYGY035AR00VRT03KE","patent","Patent prior-art and landscape intelligence skill — not generic patent help. Commits to one of five sub-use-cases via forcing intake (novelty search \u002F freedom-to-operate \u002F competitive landscape \u002F acquisition diligence \u002F litigation prior-art) before any search runs. Searches Google Patents, Espacenet, USPTO, and optionally Lens.org for citation-graph signals. Output is an editable Word document (.docx) with verdict, ranked closest art (claim-text extracted), CPC-class-aware landscape, family-resolved hits, geographic coverage, FTO flags where applicable, strategy recommendations, and full audit log. Use when the user asks for patent searching or analysis (e.g., 'prior art search for [invention]', 'freedom to operate analysis for [product]'). Produces search signal, not legal advice — always recommends consulting a patent attorney before filing or licensing decisions. Trademark, copyright, and trade-secret questions are out of scope.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fpatent\u002Fskills\u002Fpatent\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":19},"01M7BERCK1EAKTWW7R436WAR0J","notebooklm","Browser automation skill for controlling Google's NotebookLM. Use when the user wants anything done in NotebookLM (e.g., 'open NotebookLM', 'check my [name] notebook', 'ask my notebook about X', 'add [source] to NotebookLM', 'generate a Video Overview from my notebook', 'use NotebookLM Studio'). Handles reading and querying notebooks, adding sources (URLs, text, files, YouTube links, synthesized content), generating Studio outputs (Audio\u002FVideo Overviews, Mind Maps, Reports incl. Briefing Doc\u002FStudy Guide\u002FFAQ, Flashcards, Quiz, slide decks, infographics — discover the exact set from the live Studio panel; the UI evolves fast), and creating new notebooks. Requires browser automation environment — fails gracefully when unavailable.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fnotebooklm\u002Fskills\u002Fnotebooklm\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":19},"01M7BEQZAZAQRTXFJRY7RHV3TY","litreview","Academic literature orientation skill that searches papers via free keyless APIs (PubMed E-utilities + OpenAlex) by default — with the Consensus MCP as an optional enhancement lane when connected — builds a strategic search plan using PICO (default) or SPIDER \u002F Decomposition \u002F hybrid as fallbacks, and synthesizes findings into a formatted Word (.docx) research guide. Grill-me intake (research question specificity + framework hint + tentative depth) before the recon search; a second forcing checkpoint after Phase 2 confirms framework + sub-areas + depth before searches consume budget. Configurable depth (5\u002F10\u002F20 queries) controls coverage vs. speed. Output is a 'launching pad' — an orientation guide that lets a researcher dive in confidently, not a finished review. Use when the user starts literature-oriented research (e.g., 'litreview on [topic]', 'literature review on [topic]', 'I'm starting a literature review on X', 'I'm writing a paper on X', 'help me research X', 'I'm doing research on X', 'can you help me research X'). Do NOT use for single one-off paper searches wanting a quick list — that's a plain PubMed\u002FOpenAlex (or Consensus) query.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Flitreview\u002Fskills\u002Flitreview\u002FSKILL.md",[],[],{"skillNo":128,"name":129,"nameZh":6,"description":130,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":95,"licenseFileUrl":6,"sourceHtmlUrl":131,"categories":132,"keywords":133,"publishedAt":19},"01M7BEQKJ45K31QK5VRAQSVJCJ","grants","NIH grant research skill for clinical researchers. Grill-me intake (research idea + career stage + preliminary data + environment + submission posture + known institute targets) locks down the funding strategy before any search runs. Runs a 5-facet Consensus positioning analysis (with draft Significance\u002FInnovation language), maps the research to the right NIH institutes and study sections via RePORTER, finds NOSIs and funded overlap, and produces an editable Word document (.docx) with budget\u002Fscope-aware mechanism recommendations, submission timelines, and a mandatory program officer recommendation. Use when the user asks about research funding or makes any grant-related request (e.g., 'grants for [topic]', 'find grants for my research idea', 'what grants match my research', 'help me find NIH funding', 'grant opportunities for my research'). NIH-only scope — non-NIH funders (PCORI, DOD CDMRP, VA, foundations) are out of scope and flagged at intake.","https:\u002F\u002Fgithub.com\u002Fvikasvardhanv\u002Fjerry_skills\u002Fblob\u002Fmain\u002Fskills\u002Fresearch\u002Fgrants\u002Fskills\u002Fgrants\u002FSKILL.md",[],[]]