Page 1 of 1

Can't use overflow hidden in CSS

Posted: Mon May 18, 2020 8:02 pm
by brentnl
Hi,

I've a weird problem, which occured to me on several domains; sometimes I can't save a stylesheet. Instead of the green pop-up nothing shows up when I press 'apply'. And when I press 'save' the CMS is logged out and I have to login again (and the stylesheet isn't saved).

I've narrowed down the problem on my current domain; adding 'overflow: hidden' to the stylesheet causes the problem. My work arround for now is editing the stylesheet via phpmyadmin.

The stylesheet code:

Code: Select all

html,
body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Catamaran', 'Helvetica', 'Arial', 'sans-serif';
}

p {
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 20px;
}

section {
  padding: 100px 0;
}


#header {
    height: 20vh;
    [b]overflow: hidden;[/b]
}
When I change 'hidden' to 'scroll' for example, the sheet is getting saved.

Code: Select all

----------------------------------------------

Cms Version: 2.2.14

Installed Modules:

AceEditor2: 1.05
AceSyntax: 1.0.1
AdminSearch: 1.0.5
CGBetterForms: 1.10.4
CGContentUtils: 2.5.4
CGExtensions: 1.65.2
CGSimpleSmarty: 2.2.1
CGSmartImage: 1.22.7
CMSContentManager: 1.1.9
CmsJobManager: 0.1.3
DesignManager: 1.1.8
FileManager: 1.6.11
FilePicker: 1.0.4.1
Gallery: 2.4.2
MenuManager: 1.50.3
MicroTiny: 2.2.4
ModuleManager: 2.1.7
Navigator: 1.0.9
News: 2.51.10
Search: 1.51.8

Config Information:

php_memory_limit:
max_upload_size: 32000000
url_rewriting: none
page_extension:
query_var: page
auto_alias_content: true
locale:
set_names: true
timezone: Europe/Amsterdam
permissive_smarty: false

Php Information:

phpversion: 7.2.29
md5_function: Aan (Waar)
json_function: Aan (Waar)
gd_version: 2
tempnam_function: Aan (Waar)
magic_quotes_runtime: Uit (Onwaar)
E_ALL: 32767
E_STRICT: 2048
E_DEPRECATED: 8192
test_file_timedifference: Geen tijdsverschillen gevonden
test_db_timedifference: Geen tijdsverschillen gevonden
create_dir_and_file: 1
memory_limit: 96M
max_execution_time: 30
register_globals: Uit (Onwaar)
output_buffering: 4096
disable_functions: system, exec, shell_exec, passthru, proc_get_status, proc_nice, proc_terminate, dl, popen, pcntl_exec
open_basedir:
test_remote_url: Succes
file_uploads: Aan (Waar)
post_max_size: 32M
upload_max_filesize: 32M
session_save_path: /opt/alt/php72/var/lib/php/session (0700)
session_use_cookies: Aan (Waar)
xml_function: Aan (Waar)
xmlreader_class: Aan (Waar)
check_ini_set: Aan (Waar)
curl: Aan

Performance Information:

allow_browser_cache: Aan (Waar)
browser_cache_expiry: 60
php_opcache: Aan (Waar)
smarty_cache: Uit (Onwaar)
smarty_compilecheck: Uit (Onwaar)
auto_clear_cache_age: Aan (Waar)
Server Information:

Server Software: Apache
Server Api: litespeed
Server Os: Linux 3.10.0-962.3.2.lve1.5.32.el6h.x86_64 Aan x86_64
Server Db Type: MySQL (mysqli)
Server Db Version: 10.1.44
Server Db Grants: Er is een "GRAND ALL" permissie gevonden, alles lijkt in orde.

Permission Information:

tmp: /home/deb33135/domains/domein.nl/public_html/wip/f/tmp (0755)
tmp_cache: /home/deb33135/domains/domein.nl/public_html/wip/f/tmp/cache (0755)
templates_c: /home/deb33135/domains/domein.nl/public_html/wip/f/tmp/templates_c (0755)
modules: /home/deb33135/domains/domein.nl/public_html/wip/f/modules (0755)
uploads: /home/deb33135/domains/domein.nl/public_html/wip/f/uploads (0755)
Bestandscreatiemasker (umask): /home/deb33135/domains/domein.nl/public_html/wip/f/tmp/cache (0755)
config_file: 0777
----------------------------------------------
UPDATE

I took a look at the Google Chrome console and found this error when submitting the stylesheet;

Code: Select all

VM182:1 POST http://www.domein.nl/wip/f/inloggen/moduleinterface.php?showtemplate=false&m1_apply=1 403 (Forbidden)
(anonymous) @ VM182:1
send @ jquery-1.11.1.min.js:4
ajax @ jquery-1.11.1.min.js:4
m.<computed> @ jquery-1.11.1.min.js:4
(anonymous) @ moduleinterface.php?mact=DesignManager,m1_,admin_edit_css,0&__c=e705a2a8582e89e1e42&m1_css=2:184
dispatch @ jquery-1.11.1.min.js:3
r.handle @ jquery-1.11.1.min.js:3

Re: Can't use overflow hidden in CSS

Posted: Mon May 18, 2020 9:34 pm
by DIGI3
Try disabling mod_security. If you don't know how, contact your host.

Re: Can't use overflow hidden in CSS

Posted: Tue May 19, 2020 11:59 am
by brentnl
DIGI3 wrote:Try disabling mod_security. If you don't know how, contact your host.
Couldn't do it myself in Direct Admin, but my host was able to disable mod_security, which solved the problem!

But now I'm still confused, why this problem occurs sometimes. I've made multiple websites, on the same host (so with Mod_S enabled) and didn't had any issues. It feels complete random.

On what part of the code mod_security kicks in? What does it try to 'secure' ?

Re: Can't use overflow hidden in CSS

Posted: Tue May 19, 2020 1:41 pm
by DIGI3
You would need to have the host check the mod_security log to see which rule was getting triggered. False-positives aren't unusual.
If you want to have mod_security enabled your host should be able to find and whitelist this rule, but keep in mind you'll probably have similar issues pop up from time to time. Make yourself a note to always check for mod_security before troubleshooting any perceived bug, especially if there's a 400 error in the console/logs.