Mitigate XSS Attacks with Content Security Policy

Feature-Policy 헤더를 추가해 주시겠습니까?

아래는 제가 1년 넘게 사용해 온 설정입니다. (호스트: nginx)

add_header Feature-Policy “geolocation ‘none’; midi ‘none’; notifications ‘self’; push ‘none’; sync-xhr ‘none’; microphone ‘none’; camera ‘none’; magnetometer ‘none’; gyroscope ‘none’; speaker ‘none’; vibrate ‘none’; fullscreen ‘none’; payment ‘none’;”;


Content-Security-Policy 헤더에 다음 내용을 추가하는 것이 의미 있을까요? 아래는 제가 성공적으로 사용하고 있는 설정입니다. (호스트 nginx에 의해 추가되며, Discourse의 내장 CSP 위에 적용됩니다)

default-src 'none'
style-src 'self' domain 'unsafe-inline'
img-src https://*.domain.org data: blob: 'unsafe-inline'
font-src 'self' domain
connect-src 'self' domain
manifest-src 'self' domain
3개의 좋아요