Heap-buffer-overflow when adding an image in HuginBase::PanoramaMemento::loadPTScript
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Hugin |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi there
We want to share that the latest version (2022.0.0) of pto_merge causes heap-buffer-
The invalid memory allocation may attribute to the excessive values in function parameters to the HuginBase:
Here is the output of program with address sanitizer attached.
### Bug Report
=================================================================
==3616==ERROR: AddressSanitizer: heap-buffer-
READ of size 8 at 0x602000003800 thread T0
#0 0x7f3098044708 in HuginBase:
#1 0x7f3098052618 in HuginBase:
#2 0x55cfccdd8975 in main /home/ubuntu/
#3 0x7f3095746082 in __libc_start_main ../csu/
#4 0x55cfccdd9c5d in _start (/home/
0x602000003800 is located 0 bytes to the right of 16-byte region [0x6020000037f0
allocated by thread T0 here:
#0 0x7f30984f0587 in operator new(unsigned long) ../../.
#1 0x7f309802e9a9 in __gnu_cxx:
#2 0x7f309802e9a9 in std::allocator_
#3 0x7f309802e9a9 in std::_Vector_
#4 0x7f309802e9a9 in void std::vector<
#5 0x7f309802e9a9 in std::vector<
#6 0x7f309802e9a9 in HuginBase:
#7 0x7f3098052618 in HuginBase:
#8 0x55cfccdd8975 in main /home/ubuntu/
#9 0x7f3095746082 in __libc_start_main ../csu/
SUMMARY: AddressSanitizer: heap-buffer-
Shadow bytes around the buggy address:
0x0c047fff86b0: fa fa 00 00 fa fa 00 00 fa fa 04 fa fa fa 00 00
0x0c047fff86c0: fa fa 01 fa fa fa 04 fa fa fa 00 00 fa fa 00 fa
0x0c047fff86d0: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff86e0: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 04 fa
0x0c047fff86f0: fa fa 00 fa fa fa 00 fa fa fa 01 fa fa fa 00 00
=>0x0c047fff870
0x0c047fff8710: fa fa 00 fa fa fa 04 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8720: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8730: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 fa
0x0c047fff8740: fa fa 00 fa fa fa 00 fa fa fa 00 fa fa fa 00 00
0x0c047fff8750: fa fa 00 00 fa fa 04 fa fa fa 00 00 fa fa 01 fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==3616==ABORTING
### Envionment
OS: Ubuntu 20.04.5 LTS x86_64
Release: hugin 2022.0.0
Program: pto_merge
libhuginbase: 2020.0.0 (retrieved and compiled from source code)
libpano13: 2.9.19
To reproduce the problem, we need to build hugin:
sudo cmake -DCMAKE_
### How to reproduce
$ pto_merge poc-file *.jpg
(*.jpg any name of jpg file including asterisk(*))
poc-file is attached.
CVE References
description: | updated |
information type: | Private Security → Public Security |
Changed in hugin: | |
status: | Fix Committed → Fix Released |
Fixed in repository.