CVE-2023-4156: Heap out of bound read in builtin.c

Published Jun 19, 2023
·
Updated

A heap out of bound read issue exists in builtin.c of gawk prior to version 5.1.1. The array "theargs" takes an unsafe index "val", while it does not validate the index to ensure the index refers to a valid position in the array (e.g., exceedingly large or negative). The vulnerability can cause crash of the software and might be used by attackers to read sensitive information.

https://mail.gnu.org/archive/html/bug-gawk/2022-08/msg00000.html https://mail.gnu.org/archive/html/bug-gawk/2022-08/msg00023.html https://fossies.org/linux/gawk/ChangeLog#470 (Line: 470-475)

Other sources

A heap out-of-bounds read flaw was found in builtin.c in the gawk package. This issue may lead to a crash and could be used to read sensitive information.

— Ubuntu

Affected Software

12 affected componentsFixes available
ubuntu/gawk<1:5.2.1-1
1:5.2.1-1
ubuntu/gawk<1:4.1.4+dfsg-1ubuntu0.1~
1:4.1.4+dfsg-1ubuntu0.1~
ubuntu/gawk<1:5.0.1+dfsg-1ubuntu0.1
1:5.0.1+dfsg-1ubuntu0.1
ubuntu/gawk<1:5.1.0-1ubuntu0.1
1:5.1.0-1ubuntu0.1
ubuntu/gawk<1:4.0.1+dfsg-2.1ubuntu2+
1:4.0.1+dfsg-2.1ubuntu2+
ubuntu/gawk<1:4.1.3+dfsg-0.1ubuntu0.1~
1:4.1.3+dfsg-0.1ubuntu0.1~
debian/gawk<=1:4.2.1+dfsg-1, <=1:5.1.0-1
1:5.2.1-2
redhat/gawk<5.1.1
5.1.1
GNU gawk<5.1.1
redhat Enterprise Linux=6.0
redhat Enterprise Linux=7.0
Fedoraproject Fedora=38

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/gawk to a version that resolves this vulnerability.

    Fixed in 1:5.2.1-1
  2. Upgrade

    Upgrade ubuntu/gawk to a version that resolves this vulnerability.

    Fixed in 1:4.1.4+dfsg-1ubuntu0.1~
  3. Upgrade

    Upgrade ubuntu/gawk to a version that resolves this vulnerability.

    Fixed in 1:5.0.1+dfsg-1ubuntu0.1
  4. Upgrade

    Upgrade ubuntu/gawk to a version that resolves this vulnerability.

    Fixed in 1:5.1.0-1ubuntu0.1
  5. Upgrade

    Upgrade ubuntu/gawk to a version that resolves this vulnerability.

    Fixed in 1:4.0.1+dfsg-2.1ubuntu2+
  6. Upgrade

    Upgrade ubuntu/gawk to a version that resolves this vulnerability.

    Fixed in 1:4.1.3+dfsg-0.1ubuntu0.1~
  7. Upgrade

    Upgrade debian/gawk to a version that resolves this vulnerability.

    Fixed in 1:5.2.1-2
  8. Upgrade

    Upgrade redhat/gawk to a version that resolves this vulnerability.

    Fixed in 5.1.1
  9. Upgrade

    Upgrade gawk to a version that resolves this vulnerability.

    Fixed in 5.1.1

Event History

Jun 19, 2023
Data Sourced
via Red Hat·12:39 PM
DescriptionSeverityAffected Software
Aug 8, 2023
CVE Published
via Ubuntu·12:00 AM
Sep 25, 2023
CVE Published
via MITRE·05:20 PM
Data Sourced
via MITRE·05:20 PM
DescriptionSeverityWeakness

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the vulnerability ID?

The vulnerability ID is CVE-2023-4156.

2

What is the title of the vulnerability?

The title of the vulnerability is 'heap out of bound read in builtin.c'.

3

What is the severity of CVE-2023-4156?

The severity of CVE-2023-4156 is high with a severity value of 7.1.

4

What is the affected software for CVE-2023-4156?

The affected software for CVE-2023-4156 is gawk.

5

How can this vulnerability be fixed?

To fix CVE-2023-4156, update gawk to version 1:5.2.1-2 or apply the recommended patches.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203