detecting-sensitive-data-exposure

Detect hardcoded secrets, PII logging, and sensitive data exposure in Spring and JSP codebases.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/bs-koo/gx-security --skill detecting-sensitive-data-exposure-bs-koo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: detecting-sensitive-data-exposure
Source: https://github.com/bs-koo/gx-security/tree/main/skills/detecting-sensitive-data-exposure
Command: npx skills add https://github.com/bs-koo/gx-security --skill detecting-sensitive-data-exposure-bs-koo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Hardcoded database passwords, API keys, JWT secrets, and personal information often end up committed to source control in Spring Boot and legacy JSP applications, creating permanent credential leaks. This Skill scans properties, YAML, XML, Java, and JSP files to find these exposures and filters out false positives like environment variable placeholders. ## Core Features & Use Cases - Hybrid Secret Scanning: Runs a Semgrep ruleset (or regex fallback) across properties/yml/xml/java/jsp files to find hardcoded passwords, API keys, AWS keys, GitHub tokens, PEM private keys, and JDBC URL credentials. - AI Context Verification: Distinguishes real plaintext secrets from safe ${ENV_VAR} placeholders, decodes Base64-encoded credentials, and checks JSP comments for account information. - PII & Response Exposure Checks: Detects passwords and personal data (resident registration numbers, emails, phone numbers) in log statements, DTO fields serialized without @JsonIgnore, and stack traces exposed to users. - Use Case: Before committing a legacy JSP project to SVN/Git, run the scan to confirm globals.properties contains no plaintext DB password and produce a severity-ranked report with remediation steps mapped to CWE-798 and OWASP A02:2021. ## Quick Start Scan my project source for hardcoded secrets and sensitive data exposure, then report confirmed vulnerabilities with fixes.

Frequently Asked Questions about detecting-sensitive-data-exposure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scan source code for hardcoded passwords and API keys?▼

Run the scan_secrets.py script against your project directory to detect hardcoded passwords, API keys, AWS keys, GitHub tokens, and PEM private keys across properties, YAML, XML, Java, and JSP files. It uses Semgrep when available and falls back to regex patterns otherwise.

How to detect sensitive data exposure in Spring Boot applications?▼

Check application.yml for plaintext passwords, @Value annotations with secret default values, log statements containing passwords or personal data, and DTO classes with password fields missing @JsonIgnore. The Skill's Semgrep ruleset covers all of these patterns for Spring projects.

Does the scanner work without Semgrep installed?▼

Yes, the scanner falls back to regex-based detection when Semgrep is not installed. However, the fallback engine has lower recall, so a zero-finding result does not guarantee safety, and the tool prints a warning in that case.

Why are environment variable placeholders flagged as secrets?▼

They are not true positives. Values like ${DB_PASSWORD} are safe references, and the scanner explicitly excludes them from findings. The AI verification step further filters placeholders, public reCAPTCHA site keys, and test fixtures from confirmed vulnerabilities.

Can it find Base64-encoded credentials in Java source?▼

Yes, the scanner flags long Base64-looking string literals assigned to credential variables. The verification step then decodes the value to confirm whether it is an actual API key or password before classifying it as a vulnerability.

What are the limitations of regex-based secret scanning?▼

Regex scanning produces candidates rather than confirmed vulnerabilities and can miss obfuscated or split secrets. Lines longer than 5000 characters are skipped to avoid regex backtracking, and final verdicts require contextual review of each candidate.