Skip to content
Snippets Groups Projects
  • Lukas Reschke's avatar
    148e7abb
    Harden JS by disabling jQuery eval · 148e7abb
    Lukas Reschke authored
    
    Disable execution of eval in jQuery. We do require an allowed eval CSP
    configuration at the moment for handlebars et al. But for jQuery there is
    not much of a reason to execute JavaScript directly via eval.
    
    This thus mitigates some unexpected XSS vectors. As example try to insert
    `$('.fileinfo').html('<a href="asd"><script>alert(1)</script></a>');`
    with and without this patch in your browsers JS console when the file list
    is opened.
    
    Signed-off-by: default avatarLukas Reschke <lukas@statuscode.ch>
    148e7abb
    History
    Harden JS by disabling jQuery eval
    Lukas Reschke authored
    
    Disable execution of eval in jQuery. We do require an allowed eval CSP
    configuration at the moment for handlebars et al. But for jQuery there is
    not much of a reason to execute JavaScript directly via eval.
    
    This thus mitigates some unexpected XSS vectors. As example try to insert
    `$('.fileinfo').html('<a href="asd"><script>alert(1)</script></a>');`
    with and without this patch in your browsers JS console when the file list
    is opened.
    
    Signed-off-by: default avatarLukas Reschke <lukas@statuscode.ch>