Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cyrilyc charracters to unicode.mapping #2353

Open
wants to merge 2 commits into
base: v3/master
Choose a base branch
from

Conversation

zeridon
Copy link

@zeridon zeridon commented Jul 8, 2020

When using ModSecurity to protect sites written in non-english language a unicode mapping is required to translate characters to ascii (latin) equivalents. This is used in different places.

Most commonly (at least in my scenario) this falls on it heads when decoding strings and evaluating them for sql injection and similar nastiness.

If the mapping is incomplete (as currently is) the input is decoded to some garbage which triggers sql injection alert

Sample:
name1=%D0%B4%D0%B8%D0%BC%D0%B8%D1%82%D1%80%D0%BE%D0%B2 is decoded as name1: \\\\\\\\x135>@3852\ which strangely enough matches 1ov in libinjection (libinjection is not point of discussion here).

The issue is exactly the same as:

The following pull request adds mapping for some cyrilyc characters (at least for my use case). More speciffically unicode range 0x0410 - 0x44f. Attempt was made to follow as best transliteration rules, but as some glyphs are transliterated to multiple characters (e.g. Щ == SHT) some decissions have been made.

This has been tested and is currently being used in production.

Versions:

  • ModSecurity: 2.9.2 (ubuntu 18.04 packaged)
  • CRS: 3.0.2

@zimmerle zimmerle added the 3.x Related to ModSecurity version 3.x label Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants