Skip to content

pcre2_callout_enumerate fails for patterns with Unicode character classes #800

@NWilson

Description

@NWilson

This is a bug in PCRE2 10.45 and 10.46, not present in 10.44 and earlier.

Applications which call pcre2_callout_enumerate should potentially downgrade to PCRE2 10.44 until we release an update of PCRE2 with the fix.

Since this function is (clearly!!) not used often by applications, I am not currently treating this as very high severity. There is no way for an attacker to make any application call this function, if it is not currently using it.

The root cause seems to be commit 24f9d8d (#540).

(I apologise for pointing to the specific commit - I am not blaming anyone. I just think we need to be sure we understand when the bug was introduced.)

The layout of the pcre2_code object was altered from struct, nametable, code to struct, nametable, classlists, code. Nearly all the relevant code was updated, but clearly, pcre2_callout_enumerate was missed out.

We also are guilty of having inadequate code coverage of this function. We should be confident to make changes like this and know that our test suite will catch any errors. Sadly, the test suite only covers a few happy paths through pcre2_callout_enumerate, on a handful of simple patterns, and none of them have complicated character classes.


Please comment if you want to express an opinion on how we handle this bug (whether to do a rapid release, or to hurry up our scheduled 10.47, or to just fix it whenever 10.47 comes around, with no extra hurry).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions