"could not save:400 -- bad request -- ",only when I try to save templates

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
dscheff
New Member
New Member
Posts: 4
Joined: Thu May 29, 2008 11:12 pm

Re: "could not save:400 -- bad request -- ",only when I try to save templates

Post by dscheff »

Hi folks

I run on Plesk servers, and at some point either 8.1 or later, I started having these sorts of strange errors, some 500, some 400, and in several cases the fix was to put the following directive in the vhost.conf file:

SecRuleInheritance Off

Restart apache and voila!  It worked for me in this case, where the other suggestions were not helping.  Hope it helps someone else out there!
jfverville
New Member
New Member
Posts: 3
Joined: Tue Jun 03, 2008 7:52 pm

Re: "could not save:400 -- bad request -- ",only when I try to save templates

Post by jfverville »

Hi everyone,

I have this error 400 too on template editing and I noticed some strange things:

- I get the 400 error even when I try to edit the template directly on phpmyadmin!

- I don't get the error all the time. If I only write {tags} for example, it will save correctly.

This works fine:

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{sitename} - {title}</title>
{metadata}
{stylesheet}
{magpierss_in
but this doesn't work

Code: Select all

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{sitename} - {title}</title>
{metadata}
{stylesheet}
{magpierss_inc
I really don't get it. Why just adding a "c" make a 400 error...

Anyway, hope this testing will help someone find out.

Jf
alby

Re: "could not save:400 -- bad request -- ",only when I try to save templates

Post by alby »

jfverville wrote: I have this error 400 too on template editing and I noticed some strange things:

- I get the 400 error even when I try to edit the template directly on phpmyadmin!

- I don't get the error all the time. If I only write {tags} for example, it will save correctly.
Check your server logs.
Probably you have error with mod_security

Alby
jfverville
New Member
New Member
Posts: 3
Joined: Tue Jun 03, 2008 7:52 pm

Re: "could not save:400 -- bad request -- ",only when I try to save templates

Post by jfverville »

Thanks for the advice. I found the server log. You are right, the errors seems to be about ModSecurity:

Code: Select all

[Tue Jun 03 16:00:05 2008] [error] [client 64.18.xx.xx] ModSecurity: Access denied with code 400 (phase 2). Pattern match "(?:\\bhttp\\/(?:0\\.9|1\\.[01])|<(?:html|meta)\\b)" at ARGS:content. [file "/etc/modsecurity2/modsecurity_crs_40_generic_attacks.conf"] [line "211"] [id "950911"] [msg "HTTP Response Splitting Attack"] [data "<__html"] [severity "ALERT"] [hostname "mydomainx.com"] [uri "/admin/edittemplate.php"] [unique_id "jvjKZNEsfNIAACmx0iEAAAAI"]

Code: Select all

[Tue Jun 03 16:00:05 2008] [error] [client 64.18.178.73] File does not exist: /home/mydomainx/domains/mydomainx.com/public_html/400.shtml, referer: http://mydomainx.ca/admin/edittemplate.php?template_id=29
Anything I can do to fix that?

Jf
Last edited by jfverville on Wed Jun 04, 2008 1:39 am, edited 1 time in total.
jfverville
New Member
New Member
Posts: 3
Joined: Tue Jun 03, 2008 7:52 pm

Re: "could not save:400 -- bad request -- ",only when I try to save templates

Post by jfverville »

Ok I sent an email to my hosting administrator and they fixed the problem. Thanks for all!

Jf
Locked

Return to “[locked] CMSMS MLE fork”