Lucene search

K
hackeroneBnoordhuisH1:1625036
HistoryJul 04, 2022 - 10:28 p.m.

Node.js: Insecure loading of ICU data through ICU_DATA environment variable

2022-07-0422:28:55
bnoordhuis
hackerone.com
19
node.js
insecure loading
icu data
environment variable
elevated privileges
privileges level
icu
data files
icu_data
icu_no_user_data_override
bugbounty

EPSS

0

Percentile

14.1%

Node.js correctly ignores the NODE_ICU_DATA environment variable when it is running with elevated privileges (e.g. setuid root).

ICU on the other hand still honors the ICU_DATA environment variable, without regard for privilege level.

Impact

ICU is not very resilient to crafted data files but since users can select custom data files anyway with the --icu-data-dir flag, the real-world impact is probably not much worse than what is already possible through documented means…

…which doesn’t mean it shouldn’t be fixed because scenarios where it is in fact exploitable are imaginable, just not very likely.

Suggestions:

  • build ICU with ICU_NO_USER_DATA_OVERRIDE defined
  • sanitize the environment before initializing ICU