Skip to content

Commit cb9ae79

Browse files
authored
Merge pull request #1359 from jeffhuys/fix-snyk-vulnerability
Remove Key Leak 8.4.x
2 parents eed31d8 + 5aba3df commit cb9ae79

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [8.4.2] - released 2023-07-xx
10+
### Security
11+
- If a key string is provided to the CryptKey constructor with an invalid
12+
passphrase, the LogicException message generated will contain the given key.
13+
The key is no longer leaked via this exception (PR #1353)
14+
915
## [8.4.1] - released 2023-03-22
1016
### Fixed
1117
- Fix deprecation notices for PHP 8.x (PR #1329)

src/CryptKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function __construct($keyPath, $passPhrase = null, $keyPermissionsCheck =
6464
throw new LogicException('Unable to read key from file ' . $keyPath);
6565
}
6666
} else {
67-
throw new LogicException('Unable to read key from file ' . $keyPath);
67+
throw new LogicException('Invalid key supplied');
6868
}
6969

7070
if ($keyPermissionsCheck === true) {

tests/Utils/CryptKeyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testKeyString()
5555
public function testUnsupportedKeyType()
5656
{
5757
$this->expectException(\LogicException::class);
58-
$this->expectExceptionMessage('Unable to read key');
58+
$this->expectExceptionMessage('Invalid key supplied');
5959

6060
try {
6161
// Create the keypair

0 commit comments

Comments
 (0)