ppkarwasz commented on issue #4426: URL: https://github.com/apache/logging-log4j2/issues/4426#issuecomment-6809917620
> [!NOTE] > # TLP:CLEAR > This is **not** a vulnerability in Log4j. There is no CVE, no embargo and no hidden report behind this issue: everything relevant is public, on this page, and can be shared without restriction. > [!CAUTION] > As explained in #4425, this is **not** how security issues are reported. Real vulnerabilities go **privately** to [email protected], one finding per report, as described in [`SECURITY.adoc`](https://github.com/apache/logging-log4j2/blob/2.x/SECURITY.adoc) and in our [reporting guidelines](https://logging.apache.org/security.html#reporting). Read the [threat model](https://logging.apache.org/security.html#threat-common) and the [Security FAQ](https://logging.apache.org/security/faq.html) first. > > **Do not delete or blank out this issue.** Copies of this issue and of the accompanying material are archived on the Wayback Machine: > > - [This issue](https://web.archive.org/web/20261111233520/https://github.com/apache/logging-log4j2/issues/4426) > - [Exploit lab repository](https://web.archive.org/web/20261111233529/https://github.com/vindeckyy/log4j-classpath-plant-rce) Sorry for the wait. Log4j is maintained by volunteers, and reports that describe documented behavior queue up behind actual bugs and the features users ask for. This report describes documented behavior that requires an out-of-scope adversary, not a vulnerability in Log4j. The precondition is the ability to place a file on the application's classpath: "a writable classpath directory or control of a dependency artifact." An adversary with that capability does not need `log4j2.system.properties` at all. The same jar can carry a `log4j2-test.xml` that Log4j Core picks up automatically in preference to the application's own `log4j2.xml`, a Log4j plugin, a `META-INF/services` entry for `org.apache.logging.log4j.spi.Provider` that `log4j-api` instantiates on the first call to `LogManager`, or simply a class with a static initializer loaded by any other library. All of these run code in the application with no scripting engine and no property file involved. Our [threat model](https://logging.apache.org/security.html#threat-common-adversary) lists both capabilities among the out-of-scope adversaries: - an adversary able to modify configuration properties or configuration files, which `log4j2.component.properties` and `log4j2.system.properties` are; - an adversary able to execute arbitrary code in the same process as the logging framework, "including code introduced through plugins, custom appenders, or other application extensions." Code shipped in a dependency is exactly that. On the details: - That `log4j2.system.properties` is read from the classpath and copied into the Java system properties is [documented](https://logging.apache.org/log4j/2.x/manual/systemproperties.html). Writing Java system properties is the purpose of the file. - The proposed `WARN` would fire on every legitimate use of a documented feature, and it would not help against the adversary described: whoever controls the classpath also controls the logging configuration, including where status messages go. - Supply-chain integrity of the application's dependencies is the responsibility of whoever assembles the application. Our own part of it is described in the *Supply chain attacks* section of the threat model. That said, a `DEBUG` status message naming each properties file Log4j loads, and where it was found, would be a reasonable troubleshooting aid. If you want it, a pull request is welcome; please open it as a regular enhancement, not as a security fix. Closing as not planned. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
