Bug 2183006 (CVE-2021-33641) - CVE-2021-33641 byacc: malloc incorrectly accessing released memory leads to use after free
Summary: CVE-2021-33641 byacc: malloc incorrectly accessing released memory leads to u...
Keywords:
Status: NEW
Alias: CVE-2021-33641
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 2183007 2183011 2183012 2183013
Blocks: 2164081
TreeView+ depends on / blocked
 
Reported: 2023-03-30 08:08 UTC by Marian Rehak
Modified: 2023-09-26 05:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
A use-after-free flaw was found in the byacc package. When processing a specially crafted file, malloc incorrectly accesses the released memory.
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Marian Rehak 2023-03-30 08:08:08 UTC
When processing files, malloc stores the data of the current line. When processing comments, malloc incorrectly accesses the released memory (use after free).

Reference:

https://gitee.com/src-openeuler/byacc/commit/50225f48c6b53e9d7c936681a06682404cb8ec4d

Comment 1 Marian Rehak 2023-03-30 08:08:27 UTC
Created byacc tracking bugs for this issue:

Affects: fedora-all [bug 2183007]

Comment 3 Siddhesh Poyarekar 2023-03-30 14:56:13 UTC
(In reply to Marian Rehak from comment #0)
> When processing files, malloc stores the data of the current line. When
> processing comments, malloc incorrectly accesses the released memory (use
> after free).
> 
> Reference:
> 
> https://gitee.com/src-openeuler/byacc/commit/
> 50225f48c6b53e9d7c936681a06682404cb8ec4d

byacc is a standalone program, so any bugs in it, including a use-after-free ought to have no security consequences.  The reference is behind a login wall; I don't know what gitee.com is so I'd like to avoid making an account there.  Can you or the original submitter please provide information that is accessible without having to sign up for something?

Comment 4 Thomas E. Dickey 2023-03-31 07:46:37 UTC
The commit on gitee has no additional information (and proposes a band-aid fix).
There's no example of how to reproduce the problem, and does not completely fix it.
The developer did not discuss this with me.

The actual bug would occur if the grammar splits up a %lex-param or %parse-param
statement across multiple lines (or ends with a multiline C comment).

I began a fix last night, which (since I'm finishing changes to xterm) will be
completed after several days - including making testcases.

By the way, there are two Red Hat bugs for the same issue.
I will cite only this number.

Comment 5 Siddhesh Poyarekar 2023-03-31 12:37:21 UTC
(In reply to Thomas E. Dickey from comment #4)
> The commit on gitee has no additional information (and proposes a band-aid
> fix).
> There's no example of how to reproduce the problem, and does not completely
> fix it.
> The developer did not discuss this with me.
> 
> The actual bug would occur if the grammar splits up a %lex-param or
> %parse-param
> statement across multiple lines (or ends with a multiline C comment).

That sounds like a regular bug, not a security issue. I reckon this needs to be rejected, unless anybody else comes up with a reason to consider this a security bug.

> I began a fix last night, which (since I'm finishing changes to xterm) will
> be
> completed after several days - including making testcases.
> 
> By the way, there are two Red Hat bugs for the same issue.
> I will cite only this number.

I reckon you mean bug 2183007, which is the Fedora tracker for this bug?  Please use that one; this is a general flaw bug to track fixes across distributions (Fedora, RHEL, etc.)

Comment 6 Siddhesh Poyarekar 2023-03-31 12:39:15 UTC
(In reply to Siddhesh Poyarekar from comment #5)
> That sounds like a regular bug, not a security issue. I reckon this needs to
> be rejected, unless anybody else comes up with a reason to consider this a
> security bug.

FAOD, by "rejected" I mean to reject that it is a security issue by filing a dispute with Mitre.


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