•  
      request #17967 Deploy a useful content security policy
    Infos
    #17967
    Thomas Gerbet (tgerbet)
    2022-08-19 12:05
    2020-11-06 11:06
    19491
    Details
    Deploy a useful content security policy
    As of today, Tuleap sets a Content Security Policy [0] that has a very limited usefulness because it is very lax and in "allow all" mode by default. The CSP is an additional layer that could allow us to detect and mitigate XSS and other data injection/theft attacks.


    The plan is as follows:
    1. Move the current policy to a deny all mode by default but keeping it lax as it is today
    2. Set a proper and strict policy but in a report only mode
    3. Move this policy out of the report only mode


    The steps 2 and 3 are likely to be quite challenging due to some of the elements Tuleap is using (e.g. CKEditor4) or even its own code. It's also likely that to properly apply those changes it's going to require some large refactoring in the way the HTTP requests are handled.



    [0] https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
    Other
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Thomas Gerbet (tgerbet)
    Under implementation
    Empty
    Attachments
    Empty
    References
    Referencing request #17967

    Git commit

    tuleap/tuleap/stable

    Set a deny-all Content-Security-Policy header when none is set b767bc5c12
    Transform the existing lax Content-Security-Policy set on HTML pages to a deny-all default 9b050436cc
    Collect Content-Security-Violation violation reports f8d03b1090
    Report violation of the default Content-Security-Policy 09793d1cd9
    Move Content-Security-Policy violation reports to the info level fe05cc8365
    Fix Content-Security-Policy issue in docman pages 0a038a51da
    Mailman administration is not usable 1408c1058e
    Users of Chrome/Chromium based browsers cannot authorize an OAuth2 app due to the Content-Security-Policy 806218e71c
    No element on the user registration confirmation page should be blocked by the Content-Security-Policy 487b79b994
    Add the sandbox directive on the default deny-all Content-Security-Policy c39b1b73b3
    Ask for a sample when reporting a content security policy violation 71da00ba97
    Add the browser user agent to the logged CSP violation reports 8863025144
    Remove IncludeAssets::getHTMLSnippet() 2d4382c3c3
    JS error on the FP pages of the Git, SVN and OIDC plugins 4449c729f6
    Chrome complains about an invalid source in the default-src directive of the Content Security Policies 0adbdda619
    JS issues when creating/updating a release ac9b9112f5
    Harden Content-Security-Policy of the embedded documentation be17863770
    Add a nonce to script added via the global/main API 7dea175342
    Captcha plugin loads its scripts with a nonce 6efefdc0af
    All scripts of the user registration are loaded with a nonce abb304f897
    Remove unused Tracker_FormElement_Field_List_Bind::fetchDecoratorsAsJavascript dd54814c62
    All script tags in the tracker plugin have a nonce attribute 68b8d4df2c
    All script tags of the project links plugin have a nonce attribute 33c1436159
    All script tags in the FRS service have a nonce attribute f5c3399814
    Remove javascript:help_window handler 87253ba050
    Opening a document inside the docman plugin should not always open a new window daef4b352f
    Remove usage of javascript: URIs on the installed plugin page 6487bd89cc
    Remove usage of javascript: URIs in the FRS plugin app 7456537dce
    Remove usage of javascript: URIs in the Git plugin 95367f599c
    Remove usage of the javascript: URI in the project contact widget 2cee4ebcaa
    Remove usage of javascript: URIs in tracker colorpickers and workflow administration 1a3637b8cc
    Remove usage of the javascript: URI in the hudson_git plugin e5e261a4c0
    Remove usage of javascript: URIs in the SVN plugin e025af68df
    Remove usage of javascript: URIs in the tracker plugin f7d63cd63e
    Remove usage of javascript: URI on the "Add dashboard" button efe20d420c
    Remove usage of javascript: URI on the site administration project template pages 14897f69f5
    Remove usages of javascript: URIs on the PaginationPresenter 0eb047c9fe
    Remove usage of javascript: URIs in the Document plugin 626e7b8f4e
    Drop onClick handler abuse made by Prototype.js in order to support IE and old Opera browsers fa89d15f83
    Remove IncludeAssets::getHTMLSnippet() ad4076d5ae
    Remove IncludeAssets::getHTMLSnippet() 91f9dd2803

    Follow-ups

    User avatar
    Joris MASSON (jmasson)2020-12-07 15:46
    gerrit #20979 (No element on the user registration confirmation page should be blocked by the Content-Security-Policy) integrated in Tuleap 12.2.99.179
    User avatar

    gerrit #20981 (Users of Chrome/Chromium based browsers cannot authorize an OAuth2 app due to the Content-Security-Policy) integrated in Tuleap 12.2.99.172