CVE-2023-31038Apache Log4cxx: SQL injection when using ODBC appender
SQL injection in Log4cxx when using the ODBC appender to send log messages to a database. No fields sent to the database were properly escaped for SQL injection. This has been the case since at least version 0.9.0(released 2003-08-06) Note that Log4cxx is a C++ framework, so only C++ applications are affected. Before version 1.1.0, the ODBC appender was automatically part of Log4cxx if the library was found when compiling the library. As of version 1.1.0, this must be both explicitly enabled in order to be compiled in. Three preconditions must be met for this vulnerability to be possible: 1. Log4cxx compiled with ODBC support(before version 1.1.0, this was auto-detected at compile time) 2. ODBCAppender enabled for logging messages to, generally done via a config file 3. User input is logged at some point. If your application does not have user input, it is unlikely to be affected. Users are recommended to upgrade to version 1.1.0 which properly binds the parameters to the SQL statement, or migrate to the new DBAppender class which supports an ODBC connection in addition to other databases. Note that this fix does require a configuration file update, as the old configuration files will not configure properly. An example is shown below, and more information may be found in the Log4cxx documentation on the ODBCAppender. Example of old configuration snippet: <appender name="SqlODBCAppender" class="ODBCAppender"> <param name="sql" value="INSERT INTO logs (message) VALUES ('%m')" /> ... other params here ... </appender> The migrated configuration snippet with new ColumnMapping parameters: <appender name="SqlODBCAppender" class="ODBCAppender"> <param name="sql" value="INSERT INTO logs (message) VALUES (?)" /> <param name="ColumnMapping" value="message"/> ... other params here ... </appender>
What to do
Fixed builds are available from Debian: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | log4cxx | Fix pending | UBUNTU-CVE-2023-31038 | |
| Ubuntu 26.04 | log4cxx | Under investigation | UBUNTU-CVE-2023-31038 | |
| Ubuntu 25.10 | log4cxx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-31038 | |
| Ubuntu 24.04 | log4cxx | Under investigation | UBUNTU-CVE-2023-31038 | |
| Ubuntu 22.04 | log4cxx | Under investigation | UBUNTU-CVE-2023-31038 | |
| Ubuntu 20.04 | log4cxx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-31038 | |
| Ubuntu 18.04 | log4cxx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-31038 | |
| Ubuntu 16.04 | log4cxx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-31038 | |
| Ubuntu 14.04 | log4cxx | Will not fix Ubuntu decided not to fix this in this release | UBUNTU-CVE-2023-31038 | |
| Debian 14 | log4cxx | Fixed | 1.1.0-1 | DEBIAN-CVE-2023-31038 |
| Debian 13 | log4cxx | Fixed | 1.1.0-1 | DEBIAN-CVE-2023-31038 |
| Debian 12 | log4cxx | Will not fix Debian rates this unimportant for its packages (a minor issue, or one that doesn't affect Debian's build), so no security update is planned. | DEBIAN-CVE-2023-31038 | |
| Red Hat Enterprise Linux 7 | log4cxx | Not affected | ||
| Red Hat Enterprise Linux 7 | log4cxx-devel | Not affected |
What the vendor says
As published in the CVE record by apache, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- Apache Software Foundation Apache Log4cxx: affected: 0.9.0 to before 1.1.0; fixed in
1.1.0
Vendor advisories:
- https://lists.apache.org/thread/vgjlpdf353vv91gryspwxrzj6p0fbjd9 (vendor-advisory)
References
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.