summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2023-09-07 16:55:25 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-10-03 08:29:01 -0700
commit00348988396c88150f6ddfea3d3195cbf01d60c2 (patch)
treeef9ab6fae7ff1486f8abb22e0156fb09d306f7e9
parent84fb14574c039f19ad7face87eb9acc31a50701c (diff)
test: Add test case for CVE-2023-43787 (integer overflow in XCreateImage)
Provided by Yair Mizrahi of the JFrog Vulnerability Research team Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--test/pixmaps/README.md5
-rw-r--r--test/pixmaps/invalid/width-overflow.xpm31
2 files changed, 36 insertions, 0 deletions
diff --git a/test/pixmaps/README.md b/test/pixmaps/README.md
index 8f20a8b..97dd144 100644
--- a/test/pixmaps/README.md
+++ b/test/pixmaps/README.md
@@ -61,6 +61,11 @@ return XpmFileInvalid when parsed.
- corrupt-colormap.xpm - This file was generated by the clang libfuzzer,
and serves as a test for CVE-2023-43789
+- width-overflow.xpm - This file was provided by Yair Mizrahi of
+ the JFrog Vulnerability Research team as a test for CVE-2023-43787.
+ Its width causes an integer overflow when multiplied by a depth of 4 bytes
+ (32-bits) when using 32-bit ints.
+
no-mem
------
diff --git a/test/pixmaps/invalid/width-overflow.xpm b/test/pixmaps/invalid/width-overflow.xpm
new file mode 100644
index 0000000..114cb7b
--- /dev/null
+++ b/test/pixmaps/invalid/width-overflow.xpm
@@ -0,0 +1,31 @@
+/* XPM */
+/*
+ * Copyright (c) 1993, 1995, Oracle and/or its affiliates.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+static char * Dimple_pm[] = {
+/* width height ncolors cpp [x_hot y_hot] */
+"536871019 1 2 1 1 1",
+/* colors */
+" c #40a100",
+". c #434241",
+/* pixels */
+" ....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................