View Issue Details

IDProjectCategoryView StatusLast Update
0023635mantisbtwikipublic2021-08-17 13:17
ReporterTomR Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product Version2.5.2 
Summary0023635: Dokuwiki integration gives all kind of CSP errors after upgrade 1.2.20 -> 2.x
Description

Dokuwiki integration gives all kind of CSP errors after upgrade 1.2.20 -> 2.x

Upgrading from 1.2.20 to version 2.x leads to a lot of CSP errors when opening wiki pages with wiki integration from MAntisBT

TagsNo tags attached.
Attached Files
CSP-Dokuwiki.png (77,202 bytes)   
CSP-Dokuwiki.png (77,202 bytes)   
CSPHeader.png (42,522 bytes)   
CSPHeader.png (42,522 bytes)   

Relationships

has duplicate 0016383 closeddregad mantisbt [Dokuwiki - Mantis Integrating] Missing toolbar of dokuwiki's pages 
related to 0023984 confirmed mantisbt Fix MantisBT CSP settings interfering with DokuWiki 

Activities

TomR

TomR

2017-11-15 07:31

reporter   ~0058199

0019576 seems to solve the problem,
But that effectively disables CSP al together which seems a bit drastic.

In config_inc.php
$g_custom_headers = array( 'Content-Security-Policy:' );

dregad

dregad

2017-11-15 11:51

developer   ~0058200

DokuWiki integration is used on this tracker, and I have never noticed issues related to CSP.

Can you be more explicit about what the problem is, the errors you're getting, etc. Information about your setup / config may also be useful.

atrol

atrol

2017-11-15 13:30

developer   ~0058201

DokuWiki integration is used on this tracker, and I have never noticed issues related to CSP.

Maybe no obvious issues, but errors in browser console like the following one, e.g. when opening http://www.mantisbt.org/wiki/doku.php?id=mantisbt:issue:23635

Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf self blockiert ("script-src https://cdnjs.cloudflare.com http://www.mantisbt.org http://ajax.googleapis.com http://maxcdn.bootstrapcdn.com http://cdnjs.cloudflare.com"). Source: (function(H){H.className=H.className.rep....
TomR

TomR

2017-11-16 04:07

reporter   ~0058206

I was referring to other errors.

See also http://www.mantisbt.org/forums/viewtopic.php?f=3&t=25114

I expect that the problem lies in some of the extensions used on DokuWiki ( like IndexMenu plugin ).
We would not show the errors to our customers ( they will be ask us all kind of questions about it ;-(

What is an effective way to disable CSP for DokuWiki? But not for MantisBT )

atrol

atrol

2017-11-16 04:30

developer   ~0058207

Last edited: 2017-11-16 04:30

No time to have a deeper look and to try myself, just a guess.
@dregad, maybe we need some extension to function http_security_headers()
Something like

if( config_get_global( 'wiki_enable' ) == ON) {
    $t_url = config_get_global( 'wiki_engine_url' );
    http_csp_add( 'style-src', "$t_url" );
    http_csp_add( 'script-src', "$t_url" );
    http_csp_add( 'img-src', "$t_url" );
}
dregad

dregad

2017-11-16 05:17

developer   ~0058208

Last edited: 2017-11-16 05:18

Thanks @atrol. I can reproduce the behavior.

The DokuWiki integration has 2 parts:

  • Mantis -> DokuWiki
  • DokuWiki -> Mantis

I believe the problem is with the second case, more specifically the single sign-on integration, because it basically works by requiring core.php and calling several Mantis APIs (see https://mantisbt.org/wiki/doku.php/mantisbt:issue:8253#authentication_single_sign-on).

@TomR, which version of DokuWiki are you using, and do you have any particular plugins ?

TomR

TomR

2017-11-17 04:24

reporter   ~0058216

Hi @dregad,

I use Release 2017-02-19e "Frusterick Manners"

And have indeed a lot of plugins.
And i guess that for sure plugin Indexmenu plugin is giving the CSP errors.

However I also found out there is a CSPHeader plugin.
I installed it, and configured it, and now the CSP errors are gone.
Only problem is that I am not into CSP, so I do not know if i disabled CSP totally which is not recommended.

dregad

dregad

2018-01-28 19:21

developer   ~0058657

@TomR with the plugins I use, I found it sufficient to change the following settings:

  • plugin»cspheader»enableHeader - checked
  • plugin»cspheader»allowValue - 'self'
  • All other options unchecked or blank

I strongly recommend not to check optionsEval, andoptionsInline if you can avoid it - this is where the biggest security risk resides.

dregad

dregad

2018-02-15 09:22

developer   ~0058877

Resolving this issue, since a working solution exists with the DokuWiki cspheaders plugin. Note that despite the warning, the plugin works just fine with the latest version of DokuWiki (2017-02-19e "Frusterick Manners" as of this writing).

Refer to my earlier note 0023635:0058657 for minimal settings to fix the problem.

dregad

dregad

2021-08-17 13:17

developer   ~0065761

Last edited: 2021-08-17 13:17

For the record, the cspheader plugin has been updated so there is no longer a warning, and the authmantis plugin's setup page now includes recommended CSP configuration.