• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Networking & Access CSP

     
    • 0 Vote(s) - 0 Average

    CSP

    How to: CSP + Traefik
    Partition
    Offline

    Junior Member

    Posts: 7
    Threads: 2
    Joined: 2024 Apr
    Reputation: 0
    #3
    2024-04-29, 09:37 PM (This post was last modified: 2024-04-29, 09:40 PM by Partition. Edited 1 time in total.)
    (2024-04-29, 07:02 PM)niels Wrote:
    content-security-policy: default-src https: data: blob:; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob:; connect-src 'self'; object-src 'none'; frame-ancestors 'self'

    Thank you very much for your input. This solution worked for the mobile app and browser, but the csp config is still not safe enough for a valid A+ configuration. The certificate went from B ( no csp config ) to B+.
    Here is the output from Mozilla Observatory:

    Quote:Test: Content Security Policy
    Pass: No
    Score: -20
    Reason: Content Security Policy (CSP) implemented unsafely. This includes 'unsafe-inline' or data: inside script-src, overly broad sources such as https: inside object-src or script-src, or not restricting the sources for object-srcor script-src.

    Furthermore is a broad use of the default-src to "https:" and "data:" not the best option, because a load of other directives fetch the default-src value if you haven't specified them, like child-src, connect-src, frame-src, etc. Regarding the test from  https://csp-evaluator.withgoogle.com/?csp=YOURDOMAIN confirmed that the script-src is the most problematic:

    Quote:script-src - Host whitelists can frequently be bypassed. Consider using 'strict-dynamic' in combination with CSP nonces or hashes.

    'self'
    • 'self' can be problematic if you host JSONP, Angular or user uploaded files.

    error
    'unsafe-inline'
    • 'unsafe-inline' allows the execution of unsafe in-page scripts and event handlers.

    error
    https://www.gstatic.com
    • www.gstatic.com is known to host Angular libraries which allow to bypass this CSP.

    error
    https://www.youtube.com
    • www.youtube.com is known to host JSONP endpoints which allow to bypass this CSP.

    check
    blob:


    I removed the 'unsafe-inline', gstatic and youtube links and got an A+ certificate. The trailer won't load in the browser, but that's not a problem for me because the android based apps are using the external youtube app for this. The 'self' definition might also exploitable as a compromised account could upload malicious content over e.x. the profile picture uploader. I try to make my public jellyfin domain as tight as possible to avoid any future exploits, but it seems impossible without the use of 'unsafe-inline' or broader definitions...
    There has to be a way to avoid this, but I'm not familiar enough with csp headers (yet).
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    Messages In This Thread
    CSP - by Partition - 2024-04-29, 06:19 PM
    RE: CSP - by niels - 2024-04-29, 07:02 PM
    RE: CSP - by Partition - 2024-04-29, 09:37 PM
    RE: CSP - by niels - 2024-04-30, 05:37 AM
    RE: CSP - by Partition - 2024-04-30, 08:09 AM
    RE: CSP - by niels - 2024-04-30, 08:13 AM
    RE: CSP - by Partition - 2024-04-30, 08:39 AM
    RE: CSP - by niels - 2024-04-30, 08:42 AM

    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode