Debian Patches

Status for node-postcss/8.4.20+~cs8.0.23-1+deb12u1

Patch Description Author Forwarded Bugs Origin Last update
nanoid-commonjs.patch export commonjs files for nanoid Yadd <yadd@debian.org> not-needed 2022-07-04
CVE-2023-44270.patch CVE-2023-44270 Fix carrier return parsing Andrey Sitnik <andrey@sitnik.ru> no debian https://github.com/postcss/postcss/commit/58cc860b4c1707510c9cd1bc1fa30b423a9ad6c5 2023-09-29
CVE-2024-55565.patch CVE-2024-55565 Fix pool pollution, infinite loop (#510)
* Fix pool pollution, infinite loop

When nanoid is called with a fractional value, there were a number
of undesirable effects:
- in browser and non-secure, the code infinite loops on `while (size--)`
- in node, the value of poolOffset becomes fractional, causing calls to
nanoid to return zeroes until the pool is next filled: when `i` is
initialized to `poolOffset`, `pool[i] & 63` -> `undefined & 63` -> `0`
- if the first call in node is a fractional argument, the initial buffer
allocation fails with an error

I chose `|0` to cast to a signed integer primarily because that has a
slightly better outcome in the third case above: if the first call is
negative (e.g. `nanoid(-1)`) then Node will throw an error for an
invalid Buffer size, rather than attempting to allocate a buffer of
size `2**32-1`. It's also more compact than `>>>0`, which would be
necessary to cast to an unsigned integer. I don't _think_ there is
a use case for generating ids longer than `2**31-1` :)

The browser code is structured in such a way that casting `size` in
`customRandom` succinctly isn't readily feasible. I chose to cast it
at the line `let j = step | 0` since casting defaultSize would not
fix the infinite loop in all cases, and the other use of defaultSize
is to define the step length which is already shown to be fractional
and gets cast to an integer with `~` anyway.

As for the `nanoid` function, `new Uint8Array(size)` ignores the
fractional part, and `size` doesn't get used further - the function
instead calls reduce over the typed array.

In the Node/native async customAlphabet variant, I chose to convert
the `id.length === size` check to `id.length >= size`, which handles
the fractional case and avoids the infinite loop; `size` is not used
for anything else there.
Kris Reeves <kris@pressbuttonllc.com> yes upstream backport, https://github.com/ai/nanoid/commit/d643045f40d6dc8afa000a644d857da1436ed08c 2024-11-26

All known versions for source package 'node-postcss'

Links