# CVE-2022-25147: Apache Portable Runtime Utility (APR-util): out-of-bounds writes in the apr_base64 family of functions

> An integer overflow in APR-util's base64 functions allows attackers to write beyond buffer bounds, potentially leading to code execution or crashes.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Jan 2023
- **Updated:** 13 Feb 2025
- **Also known as:** ALPINE-CVE-2022-25147, ALSA-2023:3109, ALSA-2023:3147, AZL-13212, DEBIAN-CVE-2022-25147, DLA-3332-1, DSA-5364-1, GHSA-37mv-q3x5-3mwg, MGASA-2023-0045, OESA-2023-1105, OESA-2023-1108, RHSA-2023:3109, RHSA-2023:3145, RHSA-2023:3146, RHSA-2023:3147, RHSA-2023:3177, RHSA-2023:3178, RHSA-2023:3360, RHSA-2023:3380, RLSA-2023:3109, RLSA-2023:3147, SUSE-SU-2023:0324-1, SUSE-SU-2023:0325-1, SUSE-SU-2023:0337-1, SUSE-SU-2023:0338-1, SUSE-SU-2023:0389-1, UBUNTU-CVE-2022-25147, USN-5870-1, openSUSE-SU-2024:12656-1

## What is CVE-2022-25147?

CVE-2022-25147 is a medium-severity vulnerability in Apache Portable Runtime Utility (APR-util), published on 31 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Integer Overflow or Wraparound vulnerability in apr_base64 functions of Apache Portable Runtime Utility (APR-util) allows an attacker to write beyond bounds of a buffer.

This issue affects Apache Portable Runtime Utility (APR-util) 1.6.1 and prior versions.

Weakness: CWE-190 (Integer Overflow or Wraparound)

## Which versions are affected by CVE-2022-25147?

It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `apr-util` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-bdb` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-devel` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-ldap` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-mysql` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-odbc` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-openssl` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-pgsql` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util-sqlite` | AlmaLinux:8 | All versions | 1.6.1-6.el8_8.1 |
| `apr-util` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-bdb` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-devel` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-ldap` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-mysql` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-odbc` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-openssl` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-pgsql` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util-sqlite` | AlmaLinux:9 | All versions | 1.6.1-20.el9_2.1 |
| `apr-util` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-ldap` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-mysql` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-nss` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-odbc` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-openssl` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-pgsql` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-sqlite` | Red Hat:enterprise_linux:7::client | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-ldap` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-mysql` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-nss` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-odbc` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-openssl` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-pgsql` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-sqlite` | Red Hat:enterprise_linux:7::computenode | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util` | Red Hat:enterprise_linux:7::server | All versions | 0:1.5.2-6.el7_9.1 |
| `apr-util-debuginfo` | Red Hat:enterprise_linux:7::server | All versions | 0:1.5.2-6.el7_9.1 |

Products: Apache Portable Runtime Utility.

## How do I fix CVE-2022-25147?

Upgrade to a fixed version.

## Is CVE-2022-25147 being exploited?

There is no known exploitation of CVE-2022-25147 in the wild and no public exploit code.

## Other vulnerabilities in Apache Portable Runtime Utility (APR-util)

- [CVE-2017-12618](https://insights.sbomify.com/CVE-2017-12618/): Denial of service in Apache Portable Runtime (medium 4.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-25147 and fix it if it is affected.

What it is: CVE-2022-25147 is a medium-severity vulnerability in Apache Portable Runtime Utility (APR-util), published on 31 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2022-25147 in the wild and no public exploit code.

Affected product: Apache Portable Runtime Utility (APR-util). No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-25147/ (Markdown: https://insights.sbomify.com/CVE-2022-25147/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-25147
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-25147
- OSV: https://osv.dev/vulnerability/CVE-2022-25147

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-25147/
Summaries are generated and may contain mistakes; the official description above is the record.
