Appsecure logo

CVE-2022-47945: Critical Vulnerability in ThinkPHP Framework

A critical vulnerability in ThinkPHP Framework allows local file inclusion via the lang parameter. Unauthenticated attackers can exploit this flaw to execute arbitrary commands. Immediate remediation is essential.

CRITICALCVSS 9.8 · Published December 23, 2022

Not a customer? See how AppSecure simulates real world attacks to protect your infrastructure.

Speak to Experts

CVE-2022-47945 is a critical vulnerability affecting the ThinkPHP Framework versions prior to 6.0.14. This vulnerability allows local file inclusion via the lang parameter when the language pack feature is enabled (lang_switch_on=true). An unauthenticated and remote attacker can exploit this to execute arbitrary operating system commands, as demonstrated by including pearcmd.php. Given the CVSS score of 9.8, organizations must recognize the serious implications this vulnerability carries.

The severity of this vulnerability is critical due to its potential to allow remote command execution. Attackers may leverage this weakness to gain control over affected systems, leading to significant risks for organizations. Therefore, organizations should prioritize patching immediately.

Currently, there are no known exploits available in the wild for this vulnerability, which provides a window for organizations to apply the necessary updates before facing potential attacks. The urgency for defenders to address this vulnerability is paramount.

In light of these factors, organizations utilizing the ThinkPHP Framework must take immediate action to safeguard their systems from potential exploitation.

Vulnerability Details

ThinkPHP Framework before 6.0.14 allows local file inclusion via the lang parameter when the language pack feature is enabled (lang_switch_on=true). An unauthenticated and remote attacker can exploit this to execute arbitrary operating system commands, as demonstrated by including pearcmd.php. The vulnerability falls under CWE-22, indicating improper restriction of operations within the bounds of a memory buffer.

The CVSS score of 9.8 categorizes this vulnerability as critical, highlighting the severe impact it could have on confidentiality, integrity, and availability.

The affected product in this case is the ThinkPHP Framework, with the vendor being ThinkPHP. The vulnerability was published on December 23, 2022. Organizations using this framework should ensure they are running version 6.0.14 or later to mitigate this risk.

Technical Analysis

The root cause of the vulnerability lies in the improper handling of the lang parameter, which allows for local file inclusion. The attacker can exploit this through a network attack vector, requiring no privileges or user interaction. The attack complexity is low, meaning that even less-skilled attackers could successfully exploit this vulnerability.

If exploited, the vulnerability can lead to high impacts on confidentiality, integrity, and availability, as it allows for arbitrary command execution on the server.

Risk & Impact Analysis

Risk to organizations includes unauthorized access to sensitive information, system compromise, and potential disruption of services. The blast radius for this vulnerability is significant, as it can affect all instances of the ThinkPHP Framework that have not been patched. Organizations should assess their exposure to this vulnerability urgently given its high CVSS score and potential for exploitation.

Given the high EPSS score of 0.9034, organizations should take immediate action to patch or mitigate this vulnerability to protect their environments from potential attacks.

Exploitation Status

Signal

Status

Known Exploit

No

Public PoC

No

Actively Exploited

No

Ransomware Use

No

Affected Versions

The affected versions of the ThinkPHP Framework include all versions prior to 6.0.14. Organizations should ensure they have updated to this version or later to mitigate the risk associated with this vulnerability.

Mitigation & Remediation

Organizations should immediately apply the available patch by upgrading to ThinkPHP version 6.0.14 or later. If the patch cannot be applied, consider implementing workarounds that restrict access to the lang parameter and review configurations to disable the lang_switch_on feature.

Additionally, organizations may consider engaging in penetration testing to further identify and address any security weaknesses.

Detection Guidance

To detect potential exploitation of this vulnerability, organizations should monitor logs for unusual file inclusion patterns or unexpected command executions. Additionally, behavioral anomalies in application performance can indicate an active exploitation attempt.

AppSecure Threat Intelligence Insight

This vulnerability highlights the ongoing risks associated with local file inclusion flaws in web applications. Security teams should prioritize understanding the attack vectors that lead to such vulnerabilities and implement robust validation mechanisms when processing user inputs.

Organizations are encouraged to develop a comprehensive vulnerability management program that incorporates regular assessments and mitigations for known vulnerabilities.

Moreover, the incident underscores the importance of keeping software up to date. Regular updates can significantly reduce the risk of exploitation from such vulnerabilities.

For further insights on security practices, organizations might also explore penetration testing methodologies and continue to refine their defensive strategies against evolving threats.

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Latest CVEs. Recently published vulnerabilities from the NVD database.

View all vulnerabilities
CVE IDSeverity
CVE-2025-65418HIGH
CVE-2025-65417MEDIUM
CVE-2025-65416MEDIUM
CVE-2025-65415MEDIUM
CVE-2025-61314HIGH

Protect Your Business with Hacker-Focused Approach.