mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-05-31 14:12:07 +05:30
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a1a6cb7b4c | ||
|
696c78de58 | ||
|
8e5df6d628 | ||
|
295e90c27d | ||
|
788ccb8605 | ||
|
26889abdd3 | ||
|
0f19a6f41c | ||
|
4e996ab3f1 |
@@ -12,7 +12,6 @@ php:
|
||||
- 5.6
|
||||
- 7.0
|
||||
- 7.1
|
||||
- hhvm
|
||||
|
||||
install:
|
||||
- travis_retry composer install --no-interaction --prefer-source
|
||||
|
@@ -1,5 +1,12 @@
|
||||
# Changelog
|
||||
|
||||
## 5.1.5 (released 2017-07-11)
|
||||
|
||||
To address feedback from the security release the following two changes have been made:
|
||||
|
||||
* If an RSA key cannot be `chmod`'ed to 600 then it will now throw a `E_USER_NOTICE` instead of an exception.
|
||||
* Not using the new encryption key method on `AuthorizationServer` will set throw an `E_USER_DEPRECATED` message instead of an error.
|
||||
|
||||
## 5.1.4 (released 2017-07-01)
|
||||
|
||||
* Fixed multiple security vulnerabilities as a result of a security audit paid for by the [Mozilla Secure Open Source Fund](https://wiki.mozilla.org/MOSS/Secure_Open_Source). All users of this library are encouraged to update as soon as possible to this version or version 6.0 or greater.
|
||||
|
@@ -1,5 +1,11 @@
|
||||
# PHP OAuth 2.0 Server
|
||||
|
||||
### :warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:
|
||||
### Security Notice
|
||||
|
||||
### Please upgrade to version `>=5.1.4` (backwards compatible) or `6.x` (one tiny breaking change) to fix some potential security vulnerabilities
|
||||
### :warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning::warning:
|
||||
|
||||
[](https://github.com/thephpleague/oauth2-server/releases)
|
||||
[](LICENSE.md)
|
||||
[](https://travis-ci.org/thephpleague/oauth2-server)
|
||||
|
@@ -139,7 +139,7 @@ class AuthorizationServer implements EmitterAwareInterface
|
||||
|
||||
if ($this->encryptionKey === null) {
|
||||
// @codeCoverageIgnoreStart
|
||||
error_log(self::ENCRYPTION_KEY_ERROR);
|
||||
trigger_error(self::ENCRYPTION_KEY_ERROR, E_USER_DEPRECATED);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
$grantType->setEncryptionKey($this->encryptionKey);
|
||||
@@ -161,7 +161,7 @@ class AuthorizationServer implements EmitterAwareInterface
|
||||
{
|
||||
if ($this->encryptionKey === null) {
|
||||
// @codeCoverageIgnoreStart
|
||||
error_log(self::ENCRYPTION_KEY_ERROR);
|
||||
trigger_error(self::ENCRYPTION_KEY_ERROR, E_USER_DEPRECATED);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
|
@@ -29,8 +29,9 @@ class CryptKey
|
||||
/**
|
||||
* @param string $keyPath
|
||||
* @param null|string $passPhrase
|
||||
* @param bool $keyPermissionsCheck
|
||||
*/
|
||||
public function __construct($keyPath, $passPhrase = null)
|
||||
public function __construct($keyPath, $passPhrase = null, $keyPermissionsCheck = true)
|
||||
{
|
||||
if (preg_match(self::RSA_KEY_PATTERN, $keyPath)) {
|
||||
$keyPath = $this->saveKeyToFile($keyPath);
|
||||
@@ -44,19 +45,16 @@ class CryptKey
|
||||
throw new \LogicException(sprintf('Key path "%s" does not exist or is not readable', $keyPath));
|
||||
}
|
||||
|
||||
// Verify the permissions of the key
|
||||
$keyPathPerms = decoct(fileperms($keyPath) & 0777);
|
||||
if ($keyPathPerms !== '600') {
|
||||
// Attempt to correct the permissions
|
||||
if (chmod($keyPath, 0600) === false) {
|
||||
if ($keyPermissionsCheck === true) {
|
||||
// Verify the permissions of the key
|
||||
$keyPathPerms = decoct(fileperms($keyPath) & 0777);
|
||||
if (in_array($keyPathPerms, ['600', '660'], true) === false) {
|
||||
// @codeCoverageIgnoreStart
|
||||
throw new \LogicException(
|
||||
sprintf(
|
||||
'Key file "%s" permissions are not correct, should be 600 instead of %s, unable to automatically resolve the issue',
|
||||
$keyPath,
|
||||
$keyPathPerms
|
||||
)
|
||||
);
|
||||
trigger_error(sprintf(
|
||||
'Key file "%s" permissions are not correct, should be 600 or 660 instead of %s',
|
||||
$keyPath,
|
||||
$keyPathPerms
|
||||
), E_USER_NOTICE);
|
||||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user