Add Cyrilyc charracters to unicode.mapping #2353
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 asname1: \\\\\\\\x135>@3852\
which strangely enough matches1ov
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: