The parsing of the special 'ALL' case in "jwt.decrypt_alg_list" and
"jwt.decrypt_enc_list" did not check the actual string length so a too
short string could be wrongly treated as 'ALL'.
This was introduced in 3.4 by commit
f82a242c8 ("MINOR: jwe: Add option to
enable/disable algorithms or encryption algorithms for jwt_decrypt"), so
the fix must be backported to 3.4.
/* If "ALL" is used all previously disabled algo will be
* reenabled */
- if (strncmp(alg, "ALL", alg_end - alg) == 0) {
+ if (alg_end - alg == 3 && strncmp(alg, "ALL", alg_end - alg) == 0) {
set_all_alg_enc_flags(arr, ALG_ENC_ENABLED);
} else {
if (set_alg_enc_flag(arr, alg, alg_end-alg, value) != 0) {