# CVE-2016-4793: CakePHP IP address spoofing in clientIp function

Source: https://junglewise.ai/threats/cve-2016-4793-cakephp-ip-address-spoofing-in-clientip-function  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2017-01-23. Updated: 2026-05-13  
License: CC BY 4.0 with a link back

CVE-2016-4793 · Severity: high · CVSS 7.5 · Published 2017-01-23

CakePHP, a popular web development framework, contains a vulnerability that allows attackers to fake their source IP address. By sending a specially crafted web request, an attacker can trick the application into believing they are connecting from a trusted location. This can be used to bypass security restrictions, access private data, or perform unauthorized actions on the website.

Technologies: [Cakephp](https://junglewise.ai/threats/technologies/cakephp), [cakephp/cakephp (Packagist)](https://junglewise.ai/threats/technologies/cakephp-cakephp). Vendors: [Cakephp](https://junglewise.ai/threats/vendors/cakephp), [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2016-4793 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2016-4793 being exploited in the wild.

**How severe is CVE-2016-4793?** High severity, with a CVSS score of 7.5, published 23 January 2017.

**Which products and versions are affected?** cakephp/cakephp (Packagist) ECOSYSTEM:introduced=1.2.0,fixed=2.6.13.

**Is there a fix for CVE-2016-4793?** Yes. cakephp/cakephp (Packagist): upgrade to 2.6.13 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2016-4793 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2016-4793?** Check whether you run Cakephp or cakephp/cakephp (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- cakephp/cakephp (Packagist): upgrade to 2.6.13 or later

  ```sh
  composer require cakephp/cakephp:^2.6.13
  ```


## Technical details

The clientIp() method in CakePHP's Request classes (both 2.x and 3.x branches) prioritizes the HTTP_CLIENT_IP header over the REMOTE_ADDR variable provided by the web server. Because this header can be easily manipulated by a remote attacker via the 'CLIENT-IP' HTTP header, an attacker can provide an arbitrary IP address. This spoofed address is often used by applications for Access Control Lists (ACLs) or logging. If the application does not further sanitize this input, it can also lead to secondary vulnerabilities like Cross-Site Scripting (XSS) or SQL injection if the spoofed IP string is reflected or stored. The issue is fixed in versions 2.6.13, 2.7.11, 2.8.2, 3.0.17, 3.1.12, and 3.2.5.

## Affected products

- CakePHP CakePHP 2.x before 2.6.13, 2.7.11, 2.8.2; 3.x before 3.0.17, 3.1.12, 3.2.5

## Identifiers

- CVE-2016-4793
- GHSA-j8p3-8m69-2hqq

## Timeline

- 2016-03-13: patched: Vendor released security updates across multiple branches.
- 2016-05-12: disclosed: Original researcher advisory released.
- 2017-01-23: advisory: NVD published the CVE record.

## References

- [http://legalhackers.com/advisories/CakePHP-IP-Spoofing-Vulnerability.txt](http://legalhackers.com/advisories/CakePHP-IP-Spoofing-Vulnerability.txt)
- [http://www.securityfocus.com/bid/95846](http://www.securityfocus.com/bid/95846)
- [https://bakery.cakephp.org/2016/03/13/cakephp_2613_2711_282_3017_3112_325_released.html](https://bakery.cakephp.org/2016/03/13/cakephp_2613_2711_282_3017_3112_325_released.html)
- [https://support.citrix.com/article/CTX236992](https://support.citrix.com/article/CTX236992)
- [https://www.exploit-db.com/exploits/39813/](https://www.exploit-db.com/exploits/39813/)

## Related threats

- [CakePHP SQL injection in collation handling](https://junglewise.ai/threats/cve-2026-119419-cakephp-through-5-4-3-contains-an-sql-injection-vulnerability)
- [CakePHP SQL injection in WindowExpression](https://junglewise.ai/threats/cve-2026-119418-cakephp-through-5-4-3-contains-an-sql-injection-vulnerability)
- [CakePHP improper cookie domain validation in Http Client](https://junglewise.ai/threats/cve-2026-119416-cakephp-through-5-4-3-contains-an-improper-cookie-domain)
- [CakePHP CakeResponse download method header injection and XSS](https://junglewise.ai/threats/cve-2026-106512-the-cakeresponse-download-method-in-lib-cake-network)
- [CakePHP FunctionsBuilder SQL injection in multiple methods](https://junglewise.ai/threats/cve-2026-79752-cakephp-functionsbuilder-sql-injection-in-multiple-methods)
