Skip to content

Commit

Permalink
Regression test for GHSA-38h4-fx85-qcx7
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse committed Feb 19, 2025
1 parent ecfb739 commit 44737ae
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
Binary file added test/data/issue_ghsa_38h4_fx85_qcx7_poc.tiff
Binary file not shown.
22 changes: 22 additions & 0 deletions tests/bugfixes/github/test_issue_ghsa_38h4_fx85_qcx7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-

from system_tests import CaseMeta, path


class TiffSubIfd_use_after_free(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/security/advisories/GHSA-38h4-fx85-qcx7
"""

url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-38h4-fx85-qcx7"

filename = path("$data_path/issue_ghsa_38h4_fx85_qcx7_poc.tiff")
commands = ["$exiv2 -q fi $filename"]
stdout = [""]
stderr = [
"""Exiv2 exception in fixiso action for file $filename:
$kerImageWriteFailed
"""
]
retval = [1]
1 change: 1 addition & 0 deletions tests/regression_tests/test_regression_allfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def get_valid_files(data_dir):
"issue_ghsa_mxw9_qx4c_6m8v_poc.jp2",
"issue_ghsa_hrw9_ggg3_3r4r_poc.jpg",
"issue_ghsa_g9xm_7538_mq8w_poc.mov",
"issue_ghsa_38h4_fx85_qcx7_poc.tiff",
"pocIssue283.jpg",
"poc_1522.jp2",
"xmpsdk.xmp",
Expand Down
1 change: 1 addition & 0 deletions tests/suite.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jpegparsetest: ${ENV:exiv2_path}/jpegparsetest
kerOffsetOutOfRange: Offset out of range
kerFailedToReadImageData: Failed to read image data
kerInputDataReadFailed: Failed to read input data
kerImageWriteFailed: Failed to write image
kerCorruptedMetadata: corrupted image metadata
kerInvalidMalloc: invalid memory allocation request
kerInvalidTypeValue: invalid type in tiff structure
Expand Down

0 comments on commit 44737ae

Please sign in to comment.