Report
CVE-2020-15900: Ghostscript zbitshift signed integer overflow / UB in PostScript bitshift operator
e2e8dcb1-4ecf-4cbd-a1c1-375e36e3f492
CVE-2020-15900: In Ghostscript 9.52 the PostScript bitshift operator (zbitshift in psi/zrelbit.c, lines 251-286) validates the shift count is in [-max_shift, max_shift] where max_shift = (sizeof(ps_int)*8)-1 = 63 on 64-bit builds, but performing op[-1].value.intval <<= shift on a signed int with shift = 63 (or any shift that overflows the sign bit, or any left shift of a negative operand) is undefined behavior in C. The variable shift is also declared int even though op->value.intval is ps_int (int64_t on 64-bit). A one-line PostScript such as 1 63 bitshift reaches the unchecked path. Used historically as a memory disclosure / corruption primitive in -dSAFER bypass chains.