Bug 1917635 - Memory corruption (use after free) in getdata v0.10.0
Summary: Memory corruption (use after free) in getdata v0.10.0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: getdata
Version: 33
Hardware: x86_64
OS: All
unspecified
urgent
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-19 01:53 UTC by Carlos Andres Ramirez
Modified: 2021-11-25 01:04 UTC (History)
4 users (show)

Fixed In Version: getdata-0.11.0-1.fc34 getdata-0.11.0-1.fc35 getdata-0.11.0-1.fc33
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-25 00:57:53 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Vulnerability trigger - PoC (133.71 KB, application/x-xz)
2021-01-19 01:53 UTC, Carlos Andres Ramirez
no flags Details

Description Carlos Andres Ramirez 2021-01-19 01:53:47 UTC
Created attachment 1748614 [details]
Vulnerability trigger - PoC

Description of problem:
A heap memory corruption problem (use after free) can be triggered in libgetdata v0.10.0 when processing maliciously crafted dirfile databases. This degrades the confidentiality, integrity and availability of third-party software that uses libgetdata as a library. This vulnerability may lead to arbitrary code execution or privilege escalation depending on input/skills of attacker.

Version-Release number of selected component (if applicable):
getdata v0.10.0

How reproducible:
Always

Steps to Reproduce:
Vulnerability can be tested by supplying a malcrafted database file to the libgetdata library. In Ubuntu Linux, the checkdirfile utility is also vulnerable, this utility is installed by default by the getdata package.
In Fedora linux, this is located at: /usr/bin/checkdirfile

To test the vulnerability, pass a directory path containing a malcrafted FORMAT dirfile database to checkdirfile, as follows:

checkdirfile /path/to/dirfile-db/directory/

Attached is a sample malformed database with a screenshot of the memory analysis.

NOTE: For better visibility of the stack, compile the library with ASAN sanitizer.

Actual results:
Crash + Coredump

Expected results:
Program should display an error and continue/exit depending on context

Additional info:

When a RAW field specification is used with a duplicated field name in a FORMAT database fragment, the field name will be freed by _GD_ParseFieldSpec() in parse.c, but later referenced by _GD_Supports() in encoding.c when figuring out the encoding type of the RAW frames.

Tested on Fedora 33 and 32

Comment 1 Carlos Andres Ramirez 2021-01-19 01:55:58 UTC
Additional notes:

- I tried contacting the developer - but no answer. The project maintainer seems to have been inactive in the past couple of years.

Comment 2 Ben Cotton 2021-11-04 13:51:13 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Ben Cotton 2021-11-04 14:20:39 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2021-11-04 15:18:23 UTC
This message is a reminder that Fedora 33 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 33 on 2021-11-30.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '33'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 33 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 5 D. V. Wiebe 2021-11-15 23:54:37 UTC
A new version of GetData has been released to address CVE-2021-20204:

  https://github.com/ketiltrout/getdata/releases/tag/v0.11.0

Comment 6 Fedora Update System 2021-11-16 20:13:46 UTC
FEDORA-2021-197545a753 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-197545a753

Comment 7 Fedora Update System 2021-11-16 20:13:46 UTC
FEDORA-2021-3b8bb26909 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-3b8bb26909

Comment 8 Fedora Update System 2021-11-17 01:05:29 UTC
FEDORA-2021-3b8bb26909 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-3b8bb26909`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-3b8bb26909

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2021-11-17 15:08:24 UTC
FEDORA-2021-197545a753 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-197545a753`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-197545a753

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2021-11-17 16:10:10 UTC
FEDORA-2021-e2b64c614b has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-e2b64c614b`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-e2b64c614b

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2021-11-25 00:57:53 UTC
FEDORA-2021-197545a753 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2021-11-25 01:04:23 UTC
FEDORA-2021-e2b64c614b has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2021-11-25 01:04:44 UTC
FEDORA-2021-3b8bb26909 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.