diff options
| author | Paul Morelle <pmo@odoo.com> | 2020-12-10 11:41:17 +0000 |
|---|---|---|
| committer | Paul Morelle <pmo@odoo.com> | 2021-01-13 15:58:31 +0000 |
| commit | 3c5296863f0030acc5d3dba0ff73a6f1b42d1255 (patch) | |
| tree | 969ea062fac4b1e349b85da92b39ae2c62143d69 /doc/python3.rst | |
| parent | f64f7ca309f9228e58b1487a286f2302ff8f035e (diff) | |
[FIX] account: fix regexp when partner name contains +
When the name of a partner contains a regular expression operator, such
as grouping parenthesis, +, *, brackets... the resulting regexp may
match wrong names or worse be invalid and lead to an exception.
With this commit, we create a regular expression from only the words
formed from at least 3 of [a-zA-Z0-9], ignoring all other characters,
including those who may have a meaning in a regular expression.
This avoids these issues:
- regexp injection (security issue)
- punctuation resulting in erroneous regular expression ("ABC + SPRL"
resulted in "(?=.*ABC.*)(?=.*+.*)(?=.*SPRL.*)" which is invalid at
the ".*+" part)
- false positives due to words that are too small (\b were added, and
the minimal matching word size is 3)
- accentuation mismatch (both sides are filtered through unaccent)
- special cases in unicode that have a special behavior with lower().
See the discussion on odoo/odoo#63145 for a detailled explaination about
these issues.
OPW-2360687
Signed-off-by: wan <william-andre@users.noreply.github.com>
Diffstat (limited to 'doc/python3.rst')
0 files changed, 0 insertions, 0 deletions
