Cross-Site Scripting
사이트 간 스크립팅
사이트 간 스크립팅(XSS)은 공격자가 제어하는 데이터가 신뢰할 수 있는 사이트에서 브라우저 코드로 실행될 때 발생합니다.
다른 예시
게시물에는 `<img alt="" onerror=…>`가 포함되어 있습니다. 안전한 템플릿은 이를 텍스트로 삽입하고, 허용된 소규모 Markdown 집합을 정리하며, 유해한 URL을 차단하고 CSP를 적용합니다. 회귀 테스트는 HTML, 속성, URL, CSS 및 JavaScript 컨텍스트를 개별적으로 검사합니다.
주요 부분
- 01신뢰할 수 없는 소스
- 02인터프리터 컨텍스트 및 안전하지 않은 싱크
- 03인코딩/정화 경계
사용할 때
신뢰할 수 없는 출력을 정확한 컨텍스트에 맞게 인코딩하고 안전한 DOM API를 사용하세요. HTML이 허용되는 경우, 엄격한 허용 목록으로 정리하고 추가 방어로 CSP를 적용하세요.
다음 경우에는 사용하지 마세요
한 개의 탈출 함수가 모든 상황에 맞는 것은 아닙니다. 입력 검사나 CSP만으로 모든 안전하지 않은 위치를 안전하게 만들 수 없습니다.
코드에서 사용된 이름
contextual output encoding + safe sinks + HTML sanitization + CSP 출시하기 전에
Work only within an explicitly authorized and isolated defense test. Check the trust boundary, inert regression case, mitigation, and handling of secrets and personal data. Check redacted detection signals, safe failure, incident owner, recovery, and rollback. Never test a real target.
Outcome:Complete the task with 사이트 간 스크립팅 (Cross-Site Scripting)。 User context:게시물에는 `<img alt="" onerror=…>`가 포함되어 있습니다. 안전한 템플릿은 이를 텍스트로 삽입하고, 허용된 소규모 Markdown 집합을 정리하며, 유해한 URL을 차단하고 CSP를 적용합니다. 회귀 테스트는 HTML, 속성, URL, CSS 및 JavaScript 컨텍스트를 개별적으로 검사합니다. Risk or control to address:사이트 간 스크립팅 (Cross-Site Scripting)。 Why it applies:신뢰할 수 없는 출력을 정확한 컨텍스트에 맞게 인코딩하고 안전한 DOM API를 사용하세요. HTML이 허용되는 경우, 엄격한 허용 목록으로 정리하고 추가 방어로 CSP를 적용하세요. Classification boundary:한 개의 탈출 함수가 모든 상황에 맞는 것은 아닙니다. 입력 검사나 CSP만으로 모든 안전하지 않은 위치를 안전하게 만들 수 없습니다. Safety requirements: Test only in an isolated space with explicit permission. Use inert, harmless inputs. Protect secrets and personal data. Name the trust boundary and record the mitigation. Operational safeguards: Set up detection and logs that hide sensitive data. Name the incident owner. Define a safe failure mode and rollback before release. Acceptance criteria: A defensive regression test fails before the mitigation and passes after it. No real target, secret, or personal data is used. Monitoring and rollback are verified. Evidence and limits (evidence boundary):해당 출처에 대해 공식적인 것입니다. 다른 플랫폼이나 팀은 그 용어를 다른 방식으로 사용할 수 있습니다. Unknowns to confirm: Authorized scope, affected assets, data class, threat actor, incident owner, and rollback limits.
이 요청을 확인하세요
Review how 사이트 간 스크립팅 (Cross-Site Scripting) is used now. Definition: 사이트 간 스크립팅(XSS)은 공격자가 제어하는 데이터가 신뢰할 수 있는 사이트에서 브라우저 코드로 실행될 때 발생합니다. Release checks: Work only within an explicitly authorized and isolated defense test. Check the trust boundary, inert regression case, mitigation, and handling of secrets and personal data. Check redacted detection signals, safe failure, incident owner, recovery, and rollback. Never test a real target. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.