mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
GitHub CodeQL alert 591 (js/insecure-randomness, CWE-338), in the dynamic-import fork: the key that lets a request read the SERVER's dynamic modules (?key= on /__meteor__/dynamic-import/fetch) came from Math.random(), whose xorshift128+ state can be recovered from earlier outputs, and was compared with ===. meteor shell's connection key, which runs code in the server process, was made and compared the same way. Meteor 3.5.3 and 3.6-rc.0 both have this. Both forks now use crypto.randomBytes (160 and 128 bits) and compare with crypto.timingSafeEqual. tests/meteorForkRandomKeys.test.cjs runs both, and fails on any Math.random() in the forks and on a key, secret, token, nonce, salt, password or code made from Math.random() anywhere in the tree. A wrong key is not recorded in Admin Panel / Problems: another WeKan instance behind the same load balancer legitimately sends its own. Thanks to GitHub CodeQL and xet7 !