3.3 CVE-2024-9026
Exploit
In PHP versions 8.1.* before 8.1.30, 8.2.* before 8.2.24, 8.3.* before 8.3.12, when using PHP-FPM SAPI and it is configured to catch workers output through catch_workers_output = yes, it may be possible to pollute the final log or remove up to 4 characters from the log messages by manipulating log message content. Additionally, if PHP-FPM is configured to use syslog output, it may be possible to further remove log data using the same vulnerability.
https://nvd.nist.gov/vuln/detail/CVE-2024-9026
Categories
CWE-117 : Improper Output Neutralization for Logs
The product does not neutralize or incorrectly neutralizes output that is written to logs. Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.) Use and specify an output encoding that can be handled by the downstream component that is reading the output. Common encodings include ISO-8859-1, UTF-7, and UTF-8. When an encoding is not specified, a downstream component may choose a different encoding, either by assuming a default encoding or automatically inferring which encoding is being used, which can be erroneous. When the encodings are inconsistent, the downstream component might treat some character or byte sequences as special, even if they are not special in the original encoding. Attackers might then be able to exploit this discrepancy and conduct injection attacks; they even might be able to bypass protection mechanisms that assume the original encoding is also being used by the downstream component. Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked. Chain: inject fake log entries with fake timestamps using CRLF injection
CWE-NVD-Other
References
security@php.net Exploit
https://github.com/php/php-src/security/advisories/GHSA-865w-9rf3-2wh5 Exploit Third Party Advisory |
CPE
cpe | start | end |
---|---|---|
Configuration 1 | ||
cpe:2.3:a:php-fpm:php-fpm:*:*:*:*:*:*:*:* | >= 8.1.0 | < 8.1.30 |
cpe:2.3:a:php-fpm:php-fpm:*:*:*:*:*:*:*:* | >= 8.2.0 | < 8.2.24 |
cpe:2.3:a:php-fpm:php-fpm:*:*:*:*:*:*:*:* | >= 8.3.0 | < 8.3.12 |
REMEDIATION
EXPLOITS
Exploit-db.com
id | description | date | |
---|---|---|---|
No known exploits |
POC Github
Url |
---|
No known exploits |
Other Nist (github, ...)
Url |
---|
https://github.com/php/php-src/security/advisories/GHSA-865w-9rf3-2wh5 |
CAPEC
Common Attack Pattern Enumerations and Classifications
id | description | severity |
---|---|---|
268 | Audit Log Manipulation |
|
81 | Web Server Logs Tampering |
High |
93 | Log Injection-Tampering-Forging |
High |
MITRE
Techniques
id | description |
---|---|
T1070 | Indicator Removal on Host |
T1562.002 | Impair Defenses: Disable Windows Event Logging |
T1562.003 | Impair Defenses:Impair Command History Logging |
T1562.008 | Impair Defenses: Disable Cloud Logs |
© 2022 The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. |
Mitigations
id | description |
---|---|
T1070 | Protect generated event files that are stored locally with proper permissions and authentication and limit opportunities for adversaries to increase privileges by preventing Privilege Escalation opportunities. |
T1562.002 | Ensure proper user permissions are in place to prevent adversaries from disabling or interfering with logging. |
T1562.003 | Make sure that the <code>HISTCONTROL</code> environment variable is set to “ignoredups” instead of “ignoreboth” or “ignorespace”. |
T1562.008 | Configure default account policy to enable logging. Manage policies to ensure only necessary users have permissions to make changes to logging policies. |
© 2022 The MITRE Corporation. Esta obra se reproduce y distribuye con el permiso de The MITRE Corporation. |
Cybersecurity needs ?
Strengthen software security from the outset with our DevSecOps expertise
Integrate security right from the start of the software development cycle for more robust applications and greater customer confidence.
Our team of DevSecOps experts can help you secure your APIs, data pipelines, CI/CD chains, Docker containers and Kubernetes deployments.