Allow All Content Security Policy?

后端 未结 4 1237
野性不改
野性不改 2020-12-05 10:25

Is it possible to configure the Content-Security-Policy to not block anything at all? I\'m running a computer security class, and our web hacking project is running into iss

相关标签:
4条回答
  • 2020-12-05 10:27

    Here's the htaccess code to allow everything in CSP

    Header add Content-Security-Policy "default-src *  data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval' 'unsafe-dynamic'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';"
    
    0 讨论(0)
  • 2020-12-05 10:34

    The best way would be not applying any policy.

    But to answer your question, an "allow all policy" would probably be:

    default-src * 'unsafe-inline' 'unsafe-eval' data: blob:; 
    

    Note: untested

    0 讨论(0)
  • 2020-12-05 10:35

    For people who still want an even more permissive posts, because the other answers were just not permissive enough, and they must work with google chrome for which * is just not enough:

    default-src *  data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval' 'unsafe-dynamic'; 
    script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; 
    connect-src * data: blob: 'unsafe-inline'; 
    img-src * data: blob: 'unsafe-inline'; 
    frame-src * data: blob: ; 
    style-src * data: blob: 'unsafe-inline';
    font-src * data: blob: 'unsafe-inline';
    
    0 讨论(0)
  • 2020-12-05 10:38

    It's not secure at all, but as staring point the real allow all policy is:

    default-src * 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';
    

    See: https://content-security-policy.com/ and this CSP migration guide.

    0 讨论(0)
提交回复
热议问题