Skip to content

Commit 165272f

Browse files
committed
Merge branch 'version-2' into aaieduhr2
2 parents e5362b5 + a3f7643 commit 165272f

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

lib/Entity/UserEntity.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public static function fromState(array $state): self
6868
$user = new self();
6969

7070
$user->identifier = $state['id'];
71-
$user->claims = json_decode($state['claims'], true);
71+
$user->claims = json_decode($state['claims'], true, 512, JSON_INVALID_UTF8_SUBSTITUTE);
7272
$user->updatedAt = TimestampGenerator::utc($state['updated_at']);
7373
$user->createdAt = TimestampGenerator::utc($state['created_at']);
7474

@@ -82,7 +82,7 @@ public function getState(): array
8282
{
8383
return [
8484
'id' => $this->getIdentifier(),
85-
'claims' => json_encode($this->getClaims()),
85+
'claims' => json_encode($this->getClaims(), JSON_INVALID_UTF8_SUBSTITUTE),
8686
'updated_at' => $this->getUpdatedAt()->format('Y-m-d H:i:s'),
8787
'created_at' => $this->getCreatedAt()->format('Y-m-d H:i:s'),
8888
];

lib/Server/Grants/AuthCodeGrant.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,18 @@ public function respondToAccessTokenRequest(
352352
throw OAuthServerException::invalidRequest('code', 'Cannot decrypt the authorization code', $e);
353353
}
354354

355+
$codeVerifier = $this->getRequestParameter('code_verifier', $request, null);
356+
357+
// If a code challenge isn't present but a code verifier is, reject the request to block PKCE downgrade attack
358+
if ($this->shouldCheckPkce($client) && empty($authCodePayload->code_challenge) && $codeVerifier !== null) {
359+
throw OAuthServerException::invalidRequest(
360+
'code_challenge',
361+
'code_verifier received when no code_challenge is present'
362+
);
363+
}
364+
355365
// Validate code challenge
356366
if (!empty($authCodePayload->code_challenge)) {
357-
$codeVerifier = $this->getRequestParameter('code_verifier', $request, null);
358-
359367
if ($codeVerifier === null) {
360368
throw OAuthServerException::invalidRequest('code_verifier');
361369
}

templates/oidc_base.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
</div>
102102
</body>
103103
{% block postload %}
104-
<script type="text/javascript" src="{{ asset('jquery/jquery-3.3.1.min.js', 'oidc') }}"></script>
104+
<script type="text/javascript" src="{{ asset('jquery/jquery-3.6.4.min.js', 'oidc') }}"></script>
105105
<script type="text/javascript" src="{{ asset('fomantic/semantic.min.js', 'oidc') }}"></script>
106106
<script>
107107
$(document).ready(function () {

www/assets/jquery/jquery-3.3.1.min.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

www/assets/jquery/jquery-3.6.4.min.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)