Skip to main content

prevent-cross-site-scripting

Prevent reflected, stored, and DOM cross-site scripting through contextual output handling and safe APIs. Use when untrusted data can reach HTML, script, URL, style, or document execution contexts.

소스 정보

저장소
protosphinx/sphinxstack
최근 소스 활동
2026년 7월 29일 13:55
감지된 SKILL.md 언어
영어
스타
3
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

파일 탐색기
2 개 파일

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
prevent-cross-site-scripting
category
web
description
Prevent reflected, stored, and DOM cross-site scripting through contextual output handling and safe APIs. Use when untrusted data can reach HTML, script, URL, style, or document execution contexts.
# prevent-cross-site-scripting Trace untrusted data to every rendering sink and apply the control required by that exact context. ## Procedure 1. Inventory server templates, client renderers, rich-text features, URLs, messages, previews, and third-party widgets. 2. Trace untrusted sources to HTML, attribute, JavaScript, CSS, URL, SVG, and DOM sinks. 3. Use framework-native text binding and contextual escaping by default. 4. Replace unsafe APIs such as string-built markup or dynamic evaluation with typed, non-executing alternatives. 5. Sanitize intentionally allowed rich HTML with a maintained parser and a restrictive policy. 6. Validate allowed URL schemes and keep untrusted data out of executable script and style contexts. 7. Add a strict Content Security Policy as containment and detection, not as the primary fix. 8. Test stored, reflected, DOM, mutation, encoding, and framework-escape bypass cases. 9. Review dependency and browser assumptions whenever rendering libraries change. 10. Record removed sinks, sanitizer policy, tests, and remaining exceptions. ## Guardrails - Never use a regular expression as an HTML sanitizer. - Encoding for one context is unsafe when reused in another. - Do not mark arbitrary content as trusted to silence a framework warning. ## Done - A source-to-sink inventory and approved rendering patterns are documented - Representative payloads are tested in every reachable context - Unsafe sinks and sanitizer exceptions are recorded and reviewed
GitHub에서 보기