-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.ps
30 lines (26 loc) · 947 Bytes
/
test.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%!PS
% Run like this:
% ghostscript -q -dBATCH -dNODISPLAY CVE-2024-29510_testkit.ps
% Make a new tempfile but only save its path. This gives us a file path to read/write
% which will exist as long as this script runs. We don't actually use the file object
% (hence `pop`) because we're passing the path to uniprint and reopening it ourselves.
/PathTempFile () (w+) .tempfile pop def
{
% Select uniprint device with custom format strings
<<
/OutputFile PathTempFile
/OutputDevice /uniprint
/upColorModel /DeviceCMYKgenerate
/upRendering /FSCMYK32
/upOutputFormat /Pcl
/upYMoveCommand (customized format string)
>>
setpagedevice
} stopped {
% An error occurred, it is the mitigation stopping us
(Your version of Ghostscript is NOT vulnerable to CVE-2024-29510 :\)\n) print
} {
% No error was thrown, the vulnerability is not patched
(Your version of Ghostscript IS vulnerable to CVE-2024-29510 :\(\n) print
} ifelse
quit