webtrees icon indicating copy to clipboard operation
webtrees copied to clipboard

SyntaxError: Unexpected token < in JSON at position 0 Modsecurity whitelisting rule 930110 and 949110

Open zhoueysun opened this issue 2 years ago • 1 comments

Greg, you asked "I'm curious to know why this particular file upload is blocked." when I was successful in whitelisting 2 rules via my webhost Namecheap.com. The Forum link: https://www.webtrees.net/index.php/en/forum/help-for-release-2-1-x/37197-error-on-uploading-media-file-syntaxerror-unexpected-token-in-json-at-posit#93916

Modsecurity did not recommend whitelisting 949110 because that essentially turned off a good proportion of Modsecurity. So Namecheap.com reactivated 949110 and the media upload in question still works. The link for the code of rule 930110 is here https://github.com/coreruleset/coreruleset/blob/v3.3/master/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf#L49-L71
The media file I was having trouble with (it is not every media file) is attached. 1940a SCL Draft Reg

You don't have to respond to this issue because I probably won't understand it anyway. I choose to write here rather in the webtrees Forum just for privacy issues. I hope this helps. Sorry that what I whitelisted did not help Tim who was the original poster on the Forum. ~doug

zhoueysun avatar Aug 10 '22 18:08 zhoueysun

The rule says that one of the HTTP request parameters contains the text /../.

Do any of your settings, etc. contain this text?

fisharebest avatar Aug 11 '22 09:08 fisharebest

None of my settings, etc., contain this text.

zhoueysun avatar Aug 15 '22 03:08 zhoueysun

Others have figured this out. See https://www.webtrees.net/index.php/en/forum/help-for-release-2-1-x/37197-error-on-uploading-media-file-syntaxerror-unexpected-token-in-json-at-posit?start=0

zhoueysun avatar Aug 16 '22 16:08 zhoueysun