What is the maximally permissive Content-Security-Policy?

后端 未结 2 674
一生所求
一生所求 2020-12-30 10:03

I have a large, legacy codebase that I\'d like to introduce the Content-Security-Policy header on. It is not feasible in the short term to truly lock-down the s

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-30 10:52

    Try

    default-src *  data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval' 'unsafe-dynamic'; 
    script-src * 'unsafe-inline' 'unsafe-eval'; 
    connect-src * 'unsafe-inline'; 
    img-src * data: blob: 'unsafe-inline'; 
    frame-src *; 
    style-src * data: blob: 'unsafe-inline';
    font-src * data: blob: 'unsafe-inline';
    

    Even with this, you might still find violations, if you find them, report it to me!

提交回复
热议问题