Bug 1099257 - (CVE-2018-12900) VUL-0: CVE-2018-12900: tiff: Heap-based buffer overflow in the cpSeparateBufToContigBuf
(CVE-2018-12900)
VUL-0: CVE-2018-12900: tiff: Heap-based buffer overflow in the cpSeparateBufT...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P3 - Medium : Normal
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/209007/
CVSSv3:RedHat:CVE-2018-12900:3.3:(AV...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-27 08:39 UTC by Marcus Meissner
Modified: 2019-02-12 15:20 UTC (History)
4 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
poc2 (408 bytes, image/tiff)
2018-06-27 08:44 UTC, Marcus Meissner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Meissner 2018-06-27 08:39:20 UTC
Heap-based buffer overflow in the cpSeparateBufToContigBuf function in tiffcp.c
in LibTIFF 4.0.9 allows remote attackers to cause a denial of service (crash) or
possibly have unspecified other impact via a crafted TIFF file.

http://bugzilla.maptools.org/show_bug.cgi?id=2798
Comment 1 Marcus Meissner 2018-06-27 08:44:37 UTC
Created attachment 775382 [details]
poc2

QA REPRODUCER:

valgrind tiffcp -i poc2 result.tif

should not crash
should not report "Invalid write of size 1"
Comment 2 Petr Gajdos 2018-08-14 10:13:45 UTC
BEFORE

3.8.2 (11,10sp3)
4.0.9 (TW,15,12)

$ gdb -q --args tiffcp -i poc2 output.tiff
(gdb) run
[...]
DumpModeDecode: Not enough data for scanline 0, expected a request for at most 152 bytes, got a request for 4195328 bytes.

Program received signal SIGSEGV, Segmentation fault.
0x0000555555559094 in cpSeparateBufToContigBuf (bytes_per_sample=4097, spp=1024, inskew=0, outskew=<optimized out>, cols=1024, rows=0, 
    in=0x7ffff5d74803 "", out=0x7ffff6974001 "ELF\002\001\001") at tiffcp.c:1228
1228					*out++ = *in++;
(gdb) bt
#0  0x0000555555559094 in cpSeparateBufToContigBuf (bytes_per_sample=4097, spp=1024, inskew=0, outskew=<optimized out>, cols=1024, rows=0, 
    in=0x7ffff5d74803 "", out=0x7ffff6974001 "ELF\002\001\001") at tiffcp.c:1228
#1  readSeparateTilesIntoBuffer (in=0x55555575d940, buf=<optimized out>, imagelength=2, imagewidth=1, spp=1024) at tiffcp.c:1458
#2  0x0000555555558a33 in cpImage (in=0x55555575d940, out=0x55555575d010, fin=0x555555558cd0 <readSeparateTilesIntoBuffer>, 
    fout=0x555555559450 <writeBufferToSeparateTiles>, imagelength=2, imagewidth=1, spp=1024) at tiffcp.c:1253
#3  0x0000555555558b73 in cpSeparateTiles2SeparateTiles (in=<optimized out>, out=<optimized out>, imagelength=<optimized out>, 
    imagewidth=<optimized out>, spp=<optimized out>) at tiffcp.c:1747
#4  0x000055555555675f in tiffcp (out=0x55555575d010, in=0x55555575d940) at tiffcp.c:814
#5  main (argc=4, argv=0x7fffffffe858) at tiffcp.c:303
$

There's no reaction from upstream side so far. I have commented in the upstream bug.
Comment 3 Petr Gajdos 2018-08-14 11:27:22 UTC
One idea: this seems to be consequence of -i option of tiffcp. I would question whether it would be good idea to just remove that option from tiff tools.
Comment 4 Marcus Meissner 2018-08-17 13:18:03 UTC
I doubt any of our customers use the tools with -i , this lessens the impact of these issues.

for reproducibility it should probably stay.
Comment 5 Petr Gajdos 2018-08-24 05:50:52 UTC
Perhaps -i could be removed from next tiff version, I have asked upstream to consider that.
Comment 6 Petr Gajdos 2018-08-24 05:51:25 UTC
Still no reaction in upstream bug.
Comment 8 Petr Gajdos 2018-11-13 08:46:29 UTC
AFTER

4.0.9
3.8.2

$ tiffcp -i poc2 output.tiff 
[..]
poc2: Error, either TileWidth (4195328) or BitsPerSample (32776) is too large.
$
Comment 9 Petr Gajdos 2018-11-13 08:47:52 UTC
(In reply to Petr Gajdos from comment #8)
> AFTER
> 
> 4.0.9
> 3.8.2
4.0.10
> $ tiffcp -i poc2 output.tiff 
> [..]
> poc2: Error, either TileWidth (4195328) or BitsPerSample (32776) is too
> large.
> $
Comment 10 Petr Gajdos 2018-11-13 08:48:41 UTC
Will submit for TW,15,12,11,10sp3/tiff.
Comment 11 Petr Gajdos 2018-11-14 14:21:27 UTC
I believe all fixed.
Comment 14 Swamp Workflow Management 2018-11-23 20:12:33 UTC
SUSE-SU-2018:3879-1: An update that fixes 11 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1010163,1014461,1040080,1040322,1074186,1099257,1113672,974446,974447,974448,983440
CVE References: CVE-2015-8870,CVE-2016-3619,CVE-2016-3620,CVE-2016-3621,CVE-2016-5319,CVE-2016-9273,CVE-2017-17942,CVE-2017-9117,CVE-2017-9147,CVE-2018-12900,CVE-2018-18661
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    tiff-3.8.2-141.169.22.1
SUSE Linux Enterprise Server 11-SP4 (src):    tiff-3.8.2-141.169.22.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    tiff-3.8.2-141.169.22.1
Comment 15 Swamp Workflow Management 2018-11-26 20:11:36 UTC
SUSE-SU-2018:3911-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 1099257,1113094,1113672
CVE References: CVE-2018-12900,CVE-2018-18557,CVE-2018-18661
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP3 (src):    tiff-4.0.9-44.27.1
SUSE Linux Enterprise Server 12-SP3 (src):    tiff-4.0.9-44.27.1
SUSE Linux Enterprise Desktop 12-SP3 (src):    tiff-4.0.9-44.27.1
Comment 16 Swamp Workflow Management 2018-11-27 17:11:21 UTC
SUSE-SU-2018:3925-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 1099257,1113094,1113672
CVE References: CVE-2018-12900,CVE-2018-18557,CVE-2018-18661
Sources used:
SUSE Linux Enterprise Module for Packagehub Subpackages 15 (src):    tiff-4.0.9-5.17.1
SUSE Linux Enterprise Module for Open Buildservice Development Tools 15 (src):    tiff-4.0.9-5.17.1
SUSE Linux Enterprise Module for Desktop Applications 15 (src):    tiff-4.0.9-5.17.1
SUSE Linux Enterprise Module for Basesystem 15 (src):    tiff-4.0.9-5.17.1
Comment 17 Marcus Meissner 2018-11-28 07:18:33 UTC
done
Comment 18 Swamp Workflow Management 2018-11-29 23:09:59 UTC
openSUSE-SU-2018:3947-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 1099257,1113094,1113672
CVE References: CVE-2018-12900,CVE-2018-18557,CVE-2018-18661
Sources used:
openSUSE Leap 42.3 (src):    tiff-4.0.9-40.1
Comment 19 Swamp Workflow Management 2018-11-29 23:11:04 UTC
openSUSE-SU-2018:3948-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 1099257,1113094,1113672
CVE References: CVE-2018-12900,CVE-2018-18557,CVE-2018-18661
Sources used:
openSUSE Leap 15.0 (src):    tiff-4.0.9-lp150.4.9.1
Comment 20 Swamp Workflow Management 2018-12-07 11:22:04 UTC
SUSE-SU-2018:3911-2: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 1099257,1113094,1113672
CVE References: CVE-2018-12900,CVE-2018-18557,CVE-2018-18661
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP4 (src):    tiff-4.0.9-44.27.1
SUSE Linux Enterprise Server 12-SP4 (src):    tiff-4.0.9-44.27.1
SUSE Linux Enterprise Desktop 12-SP4 (src):    tiff-4.0.9-44.27.1
Comment 21 Swamp Workflow Management 2018-12-11 10:04:20 UTC
An update workflow for this issue was started.
This issue was rated as moderate.
Please submit fixed packages until 2018-12-25.
When done, reassign the bug to security-team@suse.de.
https://swamp.suse.de/webswamp/wf/64180
Comment 22 Swamp Workflow Management 2019-02-04 15:20:09 UTC
This is an autogenerated message for OBS integration:
This bug (1099257) was mentioned in
https://build.opensuse.org/request/show/671132 Factory / tiff
Comment 23 Michael Vetter 2019-02-12 14:56:46 UTC
Just for the record:
Upstream might take https://gitlab.com/libtiff/libtiff/merge_requests/60 instead of https://gitlab.com/libtiff/libtiff/merge_requests/44.

Request 60 is also needed for:
http://bugzilla.maptools.org/show_bug.cgi?id=2833 bsc#1125113

So we have both.
Comment 24 Swamp Workflow Management 2019-02-12 15:20:07 UTC
This is an autogenerated message for OBS integration:
This bug (1099257) was mentioned in
https://build.opensuse.org/request/show/674138 Factory / tiff