File: test_CVE_2017_18005.py

package info (click to toggle)
exiv2 0.28.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 109,208 kB
  • sloc: cpp: 77,571; python: 9,474; javascript: 237; makefile: 190; sh: 172; ansic: 51; sed: 16
file content (31 lines) | stat: -rw-r--r-- 984 bytes parent folder | download
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
31
# -*- coding: utf-8 -*-

import system_tests


class TestPoC(metaclass=system_tests.CaseMeta):

    url = "https://github.com/Exiv2/exiv2/issues/168"

    stderr_common = """Error: Directory Image: IFD exceeds data buffer, cannot read next pointer.
Error: Offset of directory Image, entry 0x0117 is out of bounds: Offset = 0x30303030; truncating the entry
""" + 12 * """Error: Offset of directory Image, entry 0x3030 is out of bounds: Offset = 0x30303030; truncating the entry
"""

    filename = "$data_path/cve_2017_18005_reproducer.tiff"

    commands = [
        "$exiv2 -vPEIXxgklnycsvth -b " + filename
    ]

    stdout = ["""File 1/1: """ + filename + """
0x0117 Image        Exif.Image.StripByteCounts                   StripByteCounts             Strip Byte Count               SByte       0   0  

"""
    ]
    stderr = [
        stderr_common + filename + """: No IPTC data found in the file
""" + filename + """: No XMP data found in the file
"""
    ]
    retval = [0]