본문으로 건너뛰기
Skillpedia
보안48k · #4154

client-secret-exposure-audit

하는 일

이 도구는 웹사이트에 비밀번호나 API 키 같은 민감한 정보가 실수로 노출되었는지 확인합니다. 브라우저가 볼 수 있는 코드와 공개되어서는 안 되는 설정 파일에서 이런 노출을 찾습니다.

사용하는 경우

  • ✓웹사이트를 출시하기 전에 비밀번호나 비밀 키가 보이지 않는지 확인할 때.
  • ✓기존 사이트를 검토해 잠재적 정보 유출을 찾을 때.
  • ✓중요한 설정 파일이나 소스 파일이 공개적으로 접근되지 않는지 확인해야 할 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/client-secret-exposure-audit/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/client-secret-exposure-audit/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“웹사이트 example.com에 노출된 비밀 정보가 있는지 확인해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 웹사이트가 모든 방문자에게 보여 주는 파일을 내려받습니다. 그다음 JavaScript 코드, HTML 주석, 설정 파일 등에서 비밀번호, API 키, 기타 민감한 데이터의 패턴을 검색합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Client-Side Secret & Sensitive-File Exposure Audit

Overview

Modern web apps ship a lot of code and config to the browser. When credentials leak into that client-visible surface — hardcoded in JavaScript, tucked into HTML meta/data-* attributes or comments, or served as raw source/config/deploy files that were never meant to be public — anyone can read them with curl and a browser. This skill is a defensive, read-only workflow for finding that class of exposure on a web app you are authorized to assess.

It maps to OWASP A02:2021 Cryptographic Failures (sensitive data exposure), A05:2021 Security Misconfiguration, and CWE-798 (hardcoded credentials), CWE-200 (sensitive information exposure), CWE-540 (source code in a production build). It only fetches resources the server already hands to any anonymous visitor — it does not exploit, brute-force, or mutate anything.

When to Use This Skill

  • Use when you need to check whether a deployed site leaks API keys, tokens, or passwords in its client-side bundle before shipping or during a review.
  • Use when working with a static/SPA deployment (Vercel, Netlify, Nginx, S3, GitHub Pages) and you want to confirm no source/config/deploy files are publicly reachable.
  • Use when the user asks to "find secrets," "audit exposed files," "check the JS/HTML for credentials," or run a lightweight sensitive-data-exposure pass on a URL they own or are authorized to test.
  • Do not use this to attack third-party sites. See Security & Safety Notes.

How It Works

Set the target once. Every command below reads only what the server serves publicly.

BASE="https://TARGET.example"     # authorized target, no trailing path
WORK="$(mktemp -d)"; cd "$WORK"

Step 1: Fetch the page and inspect response headers

curl -s -D headers.txt -o body.html "$BASE/"
cat headers.txt

Flag on the headers:

  • access-control-allow-origin: * — permissive CORS (worse when paired with credentials).
  • Missing Content-Security-Policy, X-Frame-Options/frame-ancestors, X-Content-Type-Options: nosniff, Referrer-Policy, Permissions-Policy.
  • Missing/weak Strict-Transport-Security.
  • Server/framework version banners that fingerprint the stack.

Step 2: Grep the HTML for secrets and sinks

grep -inE "secret|passwd|password|api[_-]?key|apikey|token|bearer|authorization|\
akia|sk_live|sk_test|pk_live|whsec_|ghp_|aiza|private[_-]?key|mongodb(\+srv)?://|\
data-[a-z-]*(secret|token|key|access)" body.html
grep -inE "<!--" body.html            # read every HTML comment
grep -ioE '<meta[^>]+>' body.html     # meta tags often carry keys/ids
grep -ioE '<script[^>]+src="[^"]+"'   body.html   # enumerate JS bundles

Secrets hide in data-* attributes, <meta> tags, hidden <div>s, and <!-- comments --> at least as often as in scripts.

Step 3: Pull every JavaScript bundle and scan it

# extract script srcs, resolve relative paths against $BASE, fetch and scan
grep -ioE 'src="[^"]+\.js"' body.html | sed -E 's/^src="//; s/"$//' \
 | while read -r p; do
     u="$p"; case "$p" in http*) ;; /*) u="$BASE$p";; *) u="$BASE/$p";; esac
     f="js_$(echo "$p" | tr '/:' '__')"
     curl -s "$u" -o "$f" && echo "== $u =="
   done
grep -rinE "secret|password|api[_-]?key|token|bearer|sk_(live|test)|pk_(live|test)|\
whsec_|akia|aiza|jwt|signing[_-]?key|admin[_-]?token|mongodb|redis://" js_* 2>/dev/null

Also scan any sourcemaps (*.js.map) — they can rebuild original source with comments intact.

Step 4: Probe for publicly reachable source / config / deploy files

SPAs often have a catch-all rewrite that returns index.html for unknown paths, so compare response sizes — a path whose size differs from the SPA fallback is a real, distinct file.

FALLBACK=$(curl -s "$BASE/____nope____$RANDOM" | wc -c)   # SPA fallback size
for p in /.env /.env.local /.env.production /.git/config /.git/HEAD \
  /package.json /package-lock.json /vercel.json /.vercel/project.json \
  /Dockerfile /docker-compose.yml /wrangler.toml /.gitignore \
  /server/index.js /src/config/app.config.js /config.js \
  /src/services/payment.service.js /webpack.config.js /next.config.js; do
    read -r code size < <(curl -s -o /dev/null -w "%{http_code} %{size_download}" "$BASE$p")
    [ "$code" = "200" ] && [ "$size" != "$FALLBACK" ] && echo "REAL FILE  $code $size  $p"
done

…

자주 묻는 질문

이 도구로 다른 웹사이트를 공격할 수 있나요?

아니요, 이 도구는 테스트 권한이 있는 웹사이트를 점검하기 위한 것입니다. 취약점을 악용하거나 아무것도 변경하지 않습니다.

‘노출된 비밀 정보’란 무엇인가요?

비밀번호, API 키, 토큰처럼 기밀인 정보가 클라이언트 쪽 코드(브라우저가 보는 코드)에 들어가, 누구나 읽을 수 있는 상태를 말합니다.

어떤 종류의 파일을 확인하나요?

JavaScript 파일, HTML 태그(메타 태그와 주석 포함), 그리고 .env, package.json, Dockerfile 같은 일반 설정 파일에 접근을 시도합니다.

상세 정보

작성자의 원본 설명

Audit a deployed web app for secrets exposed to the browser: hardcoded API keys/tokens in JS, secrets in HTML meta/attributes/comments, publicly reachable source/config/deploy files, and header/CORS misconfig.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4154
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬