Learn about DokuWiki
Learn about DokuWiki
When certain code examples are entered on a page, the Server returns a “Error 403 – Forbidden”, “Error 406 – Not Acceptable”, “Error 403 – Forbidden”, “503 – Service Temporarily Unavailable” or similar errors. What's the problem?
This is usually a problem caused by overly-restrictive security policies set in the webserver (usually mod_security) or an application level Firewall (Sophos Firewall Webapp Control is known to be problematic).
There is no way to fix this in DokuWiki, because it is not a problem caused by DokuWiki itself. You need to check your webserver or application firewall audit logs to identify the problematic rule and disable it.
Commonly problematic words are parts of SQL statements, mail or UNIX commands like:
Sometimes the problem also occurs when certain parameters are passed in the URL, especially when they contain external URLs like when using external images that are loaded from DokuWiki's image cache system in
mod_security can be disabled at a user or hosted domain level. The following two lines can be inserted in an
.htaccess file that is saved in the
SecFilterEngine Off SecFilterScanPOST Off
–Chris Freyer 7/23/09
This could be a trade off between security and usability.
In some cases it is not allowed to disable the
mod_security option in the
.htacces file. You have to contact your provider and ask for disabling some rules. In my case:
Not having worked on my wiki site for some months, my attempts to edit and then save produced the problem described above. Working with my site provider, I created a userid for the technician, who then diagnosed that the rule being triggered was “checking for 4 or more URLs in a single post”. This rule was safely disabled.
We had suspected that the rule being triggered was:
Atomicorp.com WAF AntiSpam Rules: Possible Spam: Multiple embedded urls in argument (Disable if you wish to allow 4 or more URLs in a post) .
Changing the setting on that one rule was done. A warning was given on removing mod_security:
While many sites (such as forums) would need this rule enabled to prevent spamming on their forums and usually limit the number of urls a post can have, sites that have posts with a large number of links in them (like wikis) can easily trigger this rule and may need it disabled.
Mod_security is made up of a few hundred thousand “rules” and while many developers would say “remove mod_security” this is not the recommended option.
Instead, we can disable just the specific rules that are being triggered and is the recommended option in these type of cases where updates to the scripts would not be able to fix the issue.
This could potentially open you up to the type of attack that the particular rule prevents, but disabling one rule is better then disabling all.
A little more problem determination gave a better solution.