|
|
#1 (permalink) |
|
Registered User
Comfy Contributor
Joined in Jun 2005
Lives in Singapore
Hosted on Pass15
120 posts
Gave thanks: 2
Thanked 0 times
|
403 Error with PERL in textarea
I have a peculiar problem...
I have a back-end system for me to update announcements plus formatting using HTML code. Below is the text in a TEXTAREA The POST gets processed by PHP. Both the processing and the output (admin view) is handled by a single script (ie. news.php) Code:
<h3>Updated Software versions</h3> <p>Please note that this list of software versions only reflect the last updated status.</p> <ul> <li>CPanel 10.9.0 STABLE 9966</li> <li>PERL 5.8.4</li> <li>PHP 4.4.2 (default)</li> <li>PHP 5.1.4</li> <li>MySQL 4.1.21 standard</li> </ul> In the script, I do some blank field check and then MySQL UPDATE that's all. Then I removed line by line and found that the culprit is this line: Code:
<li>PERL 5.8.4</li> |
|
|
|
|
|
#2 (permalink) |
|
He shoots.. He scores!
Super #1
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,442 posts
Gave thanks: 46
Thanked 140 times
|
Could be mod_security.
Try adding this to your htaccess <IfModule mod_security.c> SecFilterEngine Off SecFilterScanPOST Off </IfModule> PC
__________________
SH110
|
|
|
|
|
|
#3 (permalink) |
|
after g, before i
Resident.
Joined in Jul 2004
Lives in N,BC,CA
8,058 posts
Gave thanks: 48
Thanked 129 times
|
Hmm. Does mod_security have any way of notifying a script that it encountered a problem with the input? If it doesn't, they really need to consider that.. it's terrible seeing people puzzled over a problem to have it revealed as a mod_security filter.
|
|
|
|
|
|
#4 (permalink) | |
|
Registered User
Comfy Contributor
Joined in Jun 2005
Lives in Singapore
Hosted on Pass15
120 posts
Gave thanks: 2
Thanked 0 times
|
Quote:
And yes, it will be very helpful if it just say it's to do with mod security rather than 403 =( |
|
|
|
|
|
|
#5 (permalink) |
|
He shoots.. He scores!
Super #1
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,442 posts
Gave thanks: 46
Thanked 140 times
|
You know, I can honestly say, I dont know.
I would recommend opening a ticket and seeing if they could see exactly what in your script is triggering the filter. I just have a troubleshooting mentality and remember seeing this in the last few months, and was also a victim of it. PC
__________________
SH110
|
|
|
|
|
|
#6 (permalink) | |
|
He shoots.. He scores!
Super #1
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,442 posts
Gave thanks: 46
Thanked 140 times
|
Quote:
I agree, what turned me onto the mod_security is that Jake said it only happened with the specific text, otherwise it worked. I dont know if Surpass shares the settings of mod_security, so it could be kind of hit or miss. PC
__________________
SH110
|
|
|
|
|
|
|
#7 (permalink) |
|
Registered User
Comfy Contributor
Joined in Jun 2005
Lives in Singapore
Hosted on Pass15
120 posts
Gave thanks: 2
Thanked 0 times
|
Well.. knowing how i can inject PERL code into PHP would help.. but that's fine. I'm happy that I can now post the word PERL.. but I also don't want to risk myself just because of the convenience of posting one word in a million others... =/
|
|
|
|
|
|
#8 (permalink) |
|
after g, before i
Resident.
Joined in Jul 2004
Lives in N,BC,CA
8,058 posts
Gave thanks: 48
Thanked 129 times
|
True... but there's some flawed logic here. When you're doing filtering based on keywords, it's absolutely necessary to at least notify someone of the problem. I'd imagine it's likely logged into a log file, but the script should also have access to it. In other words, allow the script to determine there's a possible problem, but let it determine how to handle it. I don't know how many times I've seen people have problems with curl, which can be used in normal English conversation.
|
|
|
|
|
|
#9 (permalink) | |
|
He shoots.. He scores!
Super #1
Joined in Feb 2007
Lives in A room with no windows.
Hosted on SH110
1,442 posts
Gave thanks: 46
Thanked 140 times
|
Quote:
However, after a little googling, it appears that mod_security doesnt use logic. It appears to be a pretty black-and-white filter. From what I have found, it does get logged to :/var/log/httpd/audit_log However, us mere mortals on shared servers have no such access to that log. But I am sure a ticket to the helpdesk could get them to view/confirm. Here's a link with more info. PC
__________________
SH110
|
|
|
|
|