coreruleset / nextcloud-rule-exclusions-plugin

Rule exclusion plugin for Nextcloud
Apache License 2.0
11 stars 7 forks source link

Syntax error on line 208 #70

Closed CodeMouse92 closed 4 months ago

CodeMouse92 commented 4 months ago

This was working until today with Apache 2.4, libapache-modsecurity2 v2.9.5, CoreRuleSet 4.0, and the latest version of this plugin. Then, it abruptly stopped working, and the Apache2 service failed to start, instead showing the following error message:

> Apr 25 15:32:46 northern-paper-wasp apachectl[192098]: apache2: Syntax error on line 235 of /etc/apache2/apache2.conf: Syntax error on line 208 of /etc/crs4/plugins/nextcloud-rule-exclusions-config.conf: Expected </link> but saw </head>

What might have caused this?

azurit commented 4 months ago

@CodeMouse92 Hi. You need to review your Apache configuration, this isn't related to Nextcloud Rule Exclusion Plugin or CRS at all: Expected </link> but saw </head>

I never saw a error like this from Apache. Probably caused by some external/3rd party modules.

CodeMouse92 commented 4 months ago

I have no external/3rd party modules installed, so that's not possible. This is fairly fresh, and Christian Folini helped me triple-check my configuration. When we left it, it was working fine. Two days later, with no changes to Apache2, it's not working.

Note in the error message that the syntax error is on line 208 of nextcloud-rule-exclusions-config.conf

azurit commented 4 months ago

There is no configuration directive <link>, nor <head> in Apache httpd.

azurit commented 4 months ago

@CodeMouse92 What does this command prints? grep -R "</head>" /etc/apache2/ /etc/crs4/

azurit commented 4 months ago

Note in the error message that the syntax error is on line 208 of nextcloud-rule-exclusions-config.conf

Yes, i saw that but that file is having only 43 lines, see here.

CodeMouse92 commented 4 months ago

I found it. The wget I used to download this plugin pointed to the GitHub page displaying the file, not the raw file itself. Now...how that escaped both of us and the Apache2 server is beyond me. But, problem solved.

azurit commented 4 months ago

For me, the funniest thing is how Apache config parser blindly accepted all sorts of HTML opening tags and was trying to match them with closing tags.