A buffer overflow vulnerability in mj_raster_cmd() in contrib/japanese/gdevmjc.c of Artifex Software GhostScript v9.50 allows a remote attacker to cause a denial of service via a crafted PDF file. This is fixed in v9.51.
Created ghostscript tracking bugs for this issue:
Affects: fedora-all [bug 1870238]
A for loop condition in mj_raster_cmd() of /contrib/japanese/gdevmjc.c could cause a heap buffer overflow -> out-of-bounds read because the condition should be in reverse order. In:
for( q++ ; *q == *p && q < in_end ; q++ )
There is a check for whether q < in_end but the check occurs after q has already been dereferenced. The patch checks if q < in_end first, before dereferencing it.
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.
This issue has been addressed in the following products:
Red Hat Enterprise Linux 8
Via RHSA-2021:1852 https://access.redhat.com/errata/RHSA-2021:1852
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):