본문으로 건너뛰기
Skillpedia
보안75k · #2917

leaked-secrets

하는 일

이 스킬은 누구나 읽을 수 있는 클라이언트 코드, 페이지 소스, 프로젝트 기록에서 자격 증명을 확인합니다. 키를 비공개로 유지하려는 개발자를 위한 것입니다.

사용하는 경우

  • ✓누구나 내려받을 수 있는 JavaScript 파일에 API 키가 있을 때.
  • ✓.env 파일이 저장소에 커밋되었을 수 있을 때.
  • ✓새 서비스를 추가하면서 비밀 정보가 비공개인지 확인하고 싶을 때.

스킬 링크

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/leaked-secrets/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“제 프런트엔드 코드에 공개되면 안 되는 API 키나 비밀번호가 있는지 확인해 주실 수 있나요?”

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

작동 방식

에이전트는 페이지 소스와 JavaScript에서 비밀 정보처럼 보이는 패턴을 찾고, 프로젝트 기록에서 과거 유출을 검색합니다. 비밀 정보를 서버로 옮기고, 노출된 키는 교체하며, 비밀 정보 검사를 추가하라고 제안합니다.

기술 내용 (원본 SKILL.md)

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

Leaked Environment Variables

An API key embedded in client-side JavaScript gives anyone with a browser devtools tab full access to your cloud services, databases, or third-party APIs — leading to data breaches, unexpected charges, or account takeover.

Quick Reference

  • Any secret in client-side JavaScript is publicly readable — treat all front-end code as public
  • In Next.js, only variables prefixed with NEXT_PUBLIC_ are exposed to the browser — never put secrets in these
  • Common leak locations: .env files committed to git, hardcoded API keys in JS bundles, service account credentials in window.__INITIAL_STATE__
  • Use git log -S 'keyword' to search git history for previously committed secrets; rotate any found secrets immediately
  • Tools: GitLeaks, TruffleHog, GitHub Secret Scanning can detect leaks in repositories automatically

Check

Scan the page HTML source and JavaScript bundles for patterns that look like secrets: API keys, tokens, passwords, private keys, connection strings, or credentials. Check for common patterns like sk_, pk_, AIza, ghp_, AKIA, and base64-encoded strings in unusual contexts.

Fix

Move all secrets server-side. Replace client-exposed credentials with server-side API proxies. Rotate any leaked credentials immediately — treat them as compromised. Implement git-secrets or a pre-commit hook to prevent future leaks.

Explain

Explain why client-side JavaScript is public code, how secrets leak into bundles, what the impact of a leaked API key is, and how to architect applications to keep secrets server-side.

Code Review

Review server config, headers, forms, and integration points related to Leaked Environment Variables. Flag exact responses, cookies, or browser behaviors that violate the rule, and verify them against the effective production-like response.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/security/leaked-secrets

자주 묻는 질문

프런트엔드 코드의 키가 왜 위험한가요?

스킬은 브라우저 개발자 도구를 가진 누구나 키를 읽고 관련 서비스를 사용할 수 있다고 설명합니다.

Next.js의 공개 변수는 어떤가요?

스킬은 NEXT_PUBLIC 접두사가 붙은 변수만 브라우저에 전달되므로, 비밀 정보에는 그 접두사를 절대 쓰면 안 된다고 설명합니다.

유출 뒤에는 무엇을 해야 하나요?

스킬은 유출된 자격 증명을 즉시 교체하고 침해된 것으로 간주하라고 설명합니다.

상세 정보

작성자의 원본 설명

Use when reviewing client-side JavaScript, HTML source, or git history for exposed credentials, API keys, or tokens.

repo: thedaviddias/Front-End-Checklist

인기도

GitHub 스타
75k
순위
#2917
라이선스
MIT
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬