Skip to content

Commit feb1772

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
2 parents 851d8da + cf53f0f commit feb1772

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3-
## [v4.2.11](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.10) (2022-12-21)
3+
## [v4.2.11](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.11) (2022-12-21)
44
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.10...v4.2.11)
55

6+
### SECURITY
7+
* *Attackers may spoof IP address when using proxy* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-ghw3-5qvm-3mqc) for more information.
8+
* *Potential Session Handlers Vulnerability* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-6cq5-8cj7-g558) for more information.
9+
610
### Fixed Bugs
711
* fix: Request::getIPAddress() by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6820
812
* fix: Model cannot insert when $useAutoIncrement is false by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6827
@@ -77,6 +81,9 @@
7781
## [v4.2.7](https://github.com/codeigniter4/CodeIgniter4/tree/v4.2.7) (2022-10-06)
7882
[Full Changelog](https://github.com/codeigniter4/CodeIgniter4/compare/v4.2.6...v4.2.7)
7983

84+
### SECURITY
85+
* *Secure or HttpOnly flag set in Config\Cookie is not reflected in Cookies issued* was fixed. See the [Security advisory](https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-745p-r637-7vvp) for more information.
86+
8087
### Breaking Changes
8188
* fix: make Time::__toString() database-compatible on any locale by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6461
8289
* fix: set_cookie() does not use Config\Cookie values by @kenjis in https://github.com/codeigniter4/CodeIgniter4/pull/6544

system/HTTP/RequestTrait.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,11 @@ public function getIPAddress(): string
6464
*/
6565
// @phpstan-ignore-next-line
6666
$proxyIPs = $this->proxyIPs ?? config('App')->proxyIPs;
67-
if (! empty($proxyIPs)) {
68-
// @phpstan-ignore-next-line
69-
if (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs))) {
70-
throw new ConfigException(
71-
'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
72-
);
73-
}
67+
// @phpstan-ignore-next-line
68+
if (! empty($proxyIPs) && (! is_array($proxyIPs) || is_int(array_key_first($proxyIPs)))) {
69+
throw new ConfigException(
70+
'You must set an array with Proxy IP address key and HTTP header name value in Config\App::$proxyIPs.'
71+
);
7472
}
7573

7674
$this->ipAddress = $this->getServer('REMOTE_ADDR');

tests/_support/Database/Seeds/CITestSeeder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function run()
150150

151151
if ($this->db->DBDriver === 'MySQLi') {
152152
$data['ci_sessions'][] = [
153-
'id' => '1f5o06b43phsnnf8if6bo33b635e4p2o',
153+
'id' => 'ci_session:1f5o06b43phsnnf8if6bo33b635e4p2o',
154154
'ip_address' => '127.0.0.1',
155155
'timestamp' => '2021-06-25 21:54:14',
156156
'data' => '__ci_last_regenerate|i:1624650854;_ci_previous_url|s:40:\"http://localhost/index.php/home/index\";',
@@ -159,7 +159,7 @@ public function run()
159159

160160
if ($this->db->DBDriver === 'Postgre') {
161161
$data['ci_sessions'][] = [
162-
'id' => '1f5o06b43phsnnf8if6bo33b635e4p2o',
162+
'id' => 'ci_session:1f5o06b43phsnnf8if6bo33b635e4p2o',
163163
'ip_address' => '127.0.0.1',
164164
'timestamp' => '2021-06-25 21:54:14.991403+02',
165165
'data' => '\x' . bin2hex('__ci_last_regenerate|i:1624650854;_ci_previous_url|s:40:\"http://localhost/index.php/home/index\";'),

tests/system/Session/Handlers/Database/AbstractHandlerTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testWriteInsert()
8181
$this->setPrivateProperty($handler, 'lock', false);
8282

8383
$row = $this->db->table('ci_sessions')
84-
->getWhere(['id' => '555556b43phsnnf8if6bo33b635e4444'])
84+
->getWhere(['id' => 'ci_session:555556b43phsnnf8if6bo33b635e4444'])
8585
->getRow();
8686

8787
$this->assertGreaterThan(time() - 100, strtotime($row->timestamp));
@@ -105,7 +105,7 @@ public function testWriteUpdate()
105105
$releaseLock();
106106

107107
$row = $this->db->table('ci_sessions')
108-
->getWhere(['id' => '1f5o06b43phsnnf8if6bo33b635e4p2o'])
108+
->getWhere(['id' => 'ci_session:1f5o06b43phsnnf8if6bo33b635e4p2o'])
109109
->getRow();
110110

111111
$this->assertGreaterThan(time() - 100, strtotime($row->timestamp));

0 commit comments

Comments
 (0)