Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18
  1. #1
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default cPanel's own mod_security rules, kills cPanel's own e-list feature.

    Here's what I am running:
    WHM 11.11.0 cPanel 11.15.0-R18373
    REDHAT 5.1 i686 on standard - WHM X v3.1.0

    Also using Apache 2.2

    ISSUE: If you switch on/install the cPanel mod_security ruleset, this particular rule will make it impossible for anyone to manage their e-lists (MailMan) as access to the e-list admin page incurrs the 406 error:

    # Restrict file extension
    # removed exe so that frontpage will work
    SecRule REQUEST_BASENAME "\.(?:c(?(?:nf(?:ig)?|m)|s(?roj|r)?|dx|er|fg|md)|p(?:rinter|ass|db|ol|wd)|v(?:b(?roj|s)?|sdisco)|a(?:s(?:ax?|cx)|xd)|s(?:html?|ql|tm|ys)|d(?:bf?|at|ll|os)|$
    "t:urlDecodeUni, t:lowercase, deny,log,auditlog,msg:'URL file extension is restricted by policy', severity:'2',id:'960035'"
    -----------

    Here's the error that was being hit because of this (I changed listed IP and some other info):

    [Tue Dec 11 11:16:32 2007] [error] [client 11.11.11.11] ModSecurity: Access denied with code 406 (phase 2). Pattern match "\\\\.(?:c(?(?:nf(?:ig)?|m)|s(?roj|r)?|dx|er|fg|md)|p(?:rinter|ass|db|ol|wd)|v(?:b(?roj|s)?|sdisco)|a(?:s(?:ax?|cx)|xd)|s(?:html?|ql|tm|ys)|d(?:bf?|at|ll|os)|i(?:d[acq]|n[ci])|ba(?:[kt]|ckup)|res(?urces|x)|l(?:icx|nk|og)|\\\\w{,5}~|webinfo|ht[rw]|xs ..." at REQUEST_BASENAME. [id "960035"] [msg "URL file extension is restricted by policy"] [severity "CRITICAL"] [hostname "domain.com"] [uri "/mailman/dirname/listname_domain.com"] [unique_id "39Mjw8-a8MIAADDjDfoAAAAE"]
    -----------

    Because there are several disallowed extensions in this particular rule, I have not been able to discover exactly which part of this rule that is in conflict, so I had to comment out the entire rule.

    Questions:

    -- How could cPanel have missed this conflict with their own cPanel e-list utility?

    and

    -- Is there anyway of discovering which part of this rule that is being violated?


    Thanks.

  2. #2
    cPanelBilly
    Guest

    Default

    Not sure how that made it to distro... That rule was marked to be removed previously.

    I have contacted devel to have it removed again.

  3. #3
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    try the default rule set for modsec 2 in test branch rev 3462, does that resolve it for you?

    note to self: c 3543
    Last edited by cpdan; 04-09-2008 at 01:14 PM.

  4. #4
    Member
    Join Date
    Sep 2001
    Posts
    315

    Default

    I don't know which rule it is, but one of the rules also brakes the text editor in Joomla.

  5. #5
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Quote Originally Posted by CoolMike View Post
    I don't know which rule it is, but one of the rules also brakes the text editor in Joomla.
    To find out:

    1 -- Hit the error with a browser.

    2 -- Grep the error log, e.g.:

    grep yourdomain.com /usr/local/apache/logs/error_log

  6. #6
    Member
    Join Date
    Mar 2004
    Posts
    859

    Default

    Quote Originally Posted by cpdan View Post
    try the default rule set for modsec 2 in test branch rev 3462, does that resolve it for you?

    note to self: c 3543
    Thanks cpDan, but would you mind putting that in English

    Can I get at least some sketchy instructions about how to do this?

    Thanks.

  7. #7
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by jols View Post
    Thanks cpDan, but would you mind putting that in English

    Can I get at least some sketchy instructions about how to do this?

    Thanks.
    It means rebuild Apache, et al., doing this:

    Code:
    /scripts/easyapache --test-branch --build
    Which will rebuild everything in your profile, using code from the EasyApache Test Branch.


    BIG SCARY NOTE

    Since this is the Test Branch, your EA3 build will have new features and functions that are less tested. Other problems may arise due to using the test branch. It's not recommended for prolonged production use.

  8. #8
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    Quote Originally Posted by jols View Post
    Thanks cpDan, but would you mind putting that in English

    Can I get at least some sketchy instructions about how to do this?

    Thanks.
    Instead of rebuilding you could do this:

    Assuming yout have Apache 2 + Mod Security setup still:

    1) /usr/local/apache/conf/modsec2.user.conf still causes mailman URLs to 406, correct?

    2) wget http://httpupdate.cpanel.net/cpanels...dSec.pm.tar.gz

    3) put modsec2.user.conf.default from the root of that tarball into /usr/local/apache/conf/modsec2.user.conf

    4) restart Apache

    5) mailman URL 406's or is good now?
    Last edited by cpdan; 12-12-2007 at 09:02 AM. Reason: !! fixed incorrect filename in step 3 !!

  9. #9
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    What mailman URL is specifically being caught by mod security?

    I ask because I am unable to reproduce the problem.

  10. #10
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    Quote Originally Posted by cpdan View Post
    What mailman URL is specifically being caught by mod security?

    I ask because I am unable to reproduce the problem.
    I see it:

    URL file extension is restricted by policy

    so its the '.com' that rule doesn't like

  11. #11
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    removed, meant for internal case so it wasn't very helpful here, sory
    Last edited by cpdan; 12-12-2007 at 09:47 AM. Reason: Post was meant for internal case, sorry

  12. #12
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    fix is published, for now remove that rule via the mod sec rule editor if you wish

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge rvskin's Avatar
    Join Date
    Feb 2003
    Posts
    397

    Default

    Do you just remove it or modify it?
    If you modify, please post the correct rule here.
    RVSkin, a great experience for you, resellers and clients!
    http://www.RVSkin.com - The Most Intelligent Cpanel Skin, 23 Languages included.
    http://www.RVSiteBuilder.com - Website Builder for Hosting Provider.
    http://www.cPanelLicense.com - External cPanel License.

  14. #14
    cPanel Staff
    Join Date
    Mar 2004
    Posts
    704

    Default

    Quote Originally Posted by rvskin View Post
    Do you just remove it or modify it?
    If you modify, please post the correct rule here.
    Just removed it, it also breaks .shtml and some other "extensions" (IE the trailing .com in the mailing list URL)

  15. #15
    Member
    Join Date
    Jul 2004
    Posts
    496

    Default

    I could do with some help here please, which part of the rule is it thats causing the problem? Can you give me the lines that need deleiting so i can find it?
    Last edited by kernow; 12-21-2007 at 02:01 AM.

Similar Threads & Tags
Similar threads

  1. mod_security best rules
    By webstyler in forum Security
    Replies: 8
    Last Post: 02-13-2010, 11:46 AM
  2. mod_security rules?
    By C4talyst in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-28-2009, 02:53 PM
  3. Help with mod_security rules
    By PPNSteve in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-25-2008, 12:51 PM
  4. Feature list Cpanel
    By openland in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-17-2005, 06:03 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube