referrer-policy
하는 일
이 스킬은 사이트가 보내는 헤더를 확인하고, 다른 사이트와 공유되는 주소 정보를 제한하는 Referrer-Policy를 설정합니다. 민감한 링크와 토큰을 보호하려는 개발자를 위한 것입니다.
사용하는 경우
- ✓웹사이트의 보안 헤더를 검토해 달라고 요청할 때.
- ✓페이지 주소에 토큰이나 ID가 들어 있고, 그것이 새지 않게 하고 싶을 때.
- ✓로그인이나 세션을 다루는 앱을 강화할 때.
스킬 링크
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/referrer-policy/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 비밀번호 재설정 링크에는 토큰이 들어 있습니다. 사람들이 링크를 클릭해도 그 토큰이 다른 사이트로 새지 않게 해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 Referrer-Policy 헤더가 보내지는지 확인하고, 권장 기본값인 strict-origin-when-cross-origin으로 설정합니다. 특히 민감한 주소가 있는 페이지에는 더 엄격한 설정을 제안합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Set a Referrer-Policy header
Without a Referrer-Policy, a password reset link like https://example.com/reset?token=abc123 is included in the Referer header when the user clicks an external link on that page — leaking the token to third parties.
Quick Reference
- Use
Referrer-Policy: strict-origin-when-cross-origin— the recommended modern default strict-origin-when-cross-originsends the full URL for same-origin requests, only the origin for cross-origin HTTPS, and nothing for HTTPS→HTTP- Never use
unsafe-url— it sends the full URL including path and query string to every external site - Can be set via HTTP header,
<meta>tag, or thereferrerpolicyattribute on individual<a>and<img>elements - Sensitive URLs (reset tokens, private IDs) in query strings can be exposed via the Referer header if policy is too permissive
Check
Check whether the server sends a Referrer-Policy header and verify the value is appropriate. The recommended value is strict-origin-when-cross-origin. Check for any pages with sensitive URL parameters that could be leaked via the Referer header.
Fix
Add Referrer-Policy: strict-origin-when-cross-origin to all HTTP responses. Configure it in your web server, CDN, or application framework. For pages with particularly sensitive URLs, consider no-referrer or same-origin.
Explain
Explain what the Referer header contains, how a permissive Referrer-Policy can leak sensitive URL parameters to third parties, and what the difference is between the various Referrer-Policy values.
Code Review
Review server config, headers, forms, and integration points related to Set a Referrer-Policy header. 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/referrer-policy
자주 묻는 질문
strict-origin-when-cross-origin은 무엇을 하나요?
자기 사이트에는 전체 주소를 보내고, 다른 HTTPS 사이트에는 사이트 이름만 보내며, HTTPS에서 HTTP로 갈 때는 아무것도 보내지 않습니다.
unsafe-url은 왜 피해야 하나요?
스킬은 이 설정이 경로와 쿼리를 포함한 전체 주소를 모든 외부 사이트에 보낸다고 설명합니다.
정책은 어디에서도 설정할 수 있나요?
스킬은 meta 태그나 개별 링크와 이미지에서도 설정할 수 있다고 설명합니다.
상세 정보
작성자의 원본 설명
Use when reviewing HTTP response headers for privacy hardening on any website that handles authentication, session state, or sensitive URL parameters.
인기도
- GitHub 스타
- 75k
- 순위
- #2993
- 라이선스
- MIT
- 업데이트
- 2026. 10. 31.
댓글
- …
이 저장소의 다른 스킬
frontendchecklist
75k명령줄 도구를 사용해 380개가 넘는 규칙으로 프런트엔드 코드와 실시간 페이지를 접근성, 속도, SEO, 보안 측면에서 점검합니다.
frontend-checklist-global
75kFront-End Checklist의 386개 규칙 전체로 프런트엔드 프로젝트를 감사하고, 발견한 문제마다 구체적인 해결 방법을 제시합니다.
404-page
75k없는 페이지 화면에 도움이 되는 링크가 있고 실제 404 상태 코드를 반환하는지 확인해, 길을 잃은 방문자를 돕습니다.
about-page
75k사이트를 운영하는 사람을 설명하는 명확한 소개 페이지가 있는지 검토해, 방문자와 검색 엔진의 신뢰를 높입니다.