Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
03f1f6b
fix(sd-jwt): refuse at issuance the SD-JWTs the Holder and the Verifi…
Spomky Nov 8, 2026
3bf9ff2
fix(sd-jwt): create only the Disclosures that can be parsed
Spomky Nov 8, 2026
be17de8
Merge pull request #810 from web-token/fix/sd-jwt-disclosure-factory-…
Spomky Nov 9, 2026
0063d26
test(sd-jwt): keep the anonymous JsonSerializable valid on PHP 8.2
Spomky Nov 9, 2026
6872121
Remove the Scorecards workflow
Spomky Nov 9, 2026
53a9820
Merge pull request #809 from web-token/fix/sd-jwt-issuer-bounds
Spomky Nov 9, 2026
85d5df0
Merge pull request #811 from web-token/ci/remove-scorecards-workflow
Spomky Nov 9, 2026
5af8fc4
fix(console): inject the key factory into the generator commands thro…
Spomky Nov 9, 2026
81b91bb
fix(sd-jwt): tell the decoding bounds apart from invalid JSON
Spomky Nov 9, 2026
78b56db
Merge pull request #812 from web-token/fix/generator-command-factory-…
Spomky Nov 9, 2026
da615c9
Merge pull request #813 from web-token/fix/sd-jwt-parse-budget-message
Spomky Nov 9, 2026
5d55912
fix(sd-jwt): name the bound a Disclosure factory hits
Spomky Nov 9, 2026
16d327d
fix(sd-jwt): refuse the unparsable unprotected headers as the other c…
Spomky Nov 9, 2026
3f69217
Merge pull request #814 from web-token/fix/sd-jwt-disclosure-factory-…
Spomky Nov 9, 2026
51eee52
Merge pull request #815 from web-token/fix/sd-jwt-issuer-header-bounds
Spomky Nov 9, 2026
f4f96fb
fix(serializers): name the bound a token goes beyond when it is decoded
Spomky Nov 9, 2026
80bbda4
Merge pull request #816 from web-token/fix/jose-serializers-decoding-…
Spomky Nov 9, 2026
5c1ae54
fix(serializers): chain the bound a token goes beyond in the serializ…
Spomky Nov 9, 2026
69e9709
Merge pull request #817 from web-token/fix/jose-serializer-managers-b…
Spomky Nov 9, 2026
6ee5c8e
fix(serializers): chain the reason of the serializer a token belongs to
Spomky Nov 9, 2026
e39db7e
Merge pull request #818 from web-token/fix/jose-serializer-managers-f…
Spomky Nov 9, 2026
645d0cc
fix(json): bound the JSON documents decoded outside of a token
Spomky Nov 9, 2026
58c95a9
fix(composer): require web-token/jwt-library ^4.3 in the bundle and e…
Spomky Nov 9, 2026
b1e2cd8
fix(key-management): JKUFactory and X5UFactory extend UrlKeySetFactor…
Spomky Nov 9, 2026
088e151
fix(bundle): keep the service ids of the library "none" and "RSA1_5" …
Spomky Nov 9, 2026
fff20ac
Merge pull request #822 from web-token/fix/bundle-deprecated-none-rsa…
Spomky Nov 10, 2026
1ef1366
Merge pull request #821 from web-token/fix/jku-x5u-factories-extend-u…
Spomky Nov 10, 2026
4d427a4
Merge pull request #820 from web-token/fix/split-packages-require-lib…
Spomky Nov 10, 2026
41c097d
Merge pull request #819 from web-token/fix/json-decoding-bounds
Spomky Nov 10, 2026
f222aed
fix(key-mgmt): analyze RSA n and e and EC coordinates by their intege…
lav45 Nov 10, 2026
c35731c
fix(key-mgmt): measure the RSA modulus and exponent on their octets
Spomky Nov 10, 2026
dafe074
fix(key-mgmt): stop the EC analysis on coordinates of the wrong size
Spomky Nov 10, 2026
3d4c72e
ci(github): use a closing keyword in the pull request template
Spomky Nov 10, 2026
024031b
Merge pull request #826 from web-token/ci/pr-template-closing-keyword
Spomky Nov 10, 2026
0893d6f
Merge pull request #825 from web-token/fix/key-analyzers-integer-enco…
Spomky Nov 10, 2026
e960c7c
fix(core): bound the RSA public exponent to 64 bits whatever the modulus
Spomky Nov 23, 2026
4029d7e
ci: add to the PHPStan baseline the three conditions PHPStan 2.3.7 re…
Spomky Nov 23, 2026
284c2e2
Merge pull request #828 from web-token/fix/rsa-public-exponent-64-bits
Spomky Nov 23, 2026
53eee3f
Compute the RSA public operation with OpenSSL
Spomky Nov 8, 2026
cf84b60
Compute the RSA private operation with OpenSSL
Spomky Nov 29, 2026
d578701
Sign with RSA-PSS through OpenSSL
Spomky Nov 29, 2026
3c980dd
ci: add to the PHPStan baseline the four errors reported on 4.3.x wha…
Spomky Nov 29, 2026
011e764
Merge pull request #832 from web-token/ci/phpstan-baseline-2-3-7-4-3-x
Spomky Nov 29, 2026
d65a08e
fix(encryption): check the size of an AES-GCM wrapped key before unwr…
Spomky Nov 29, 2026
144a8e7
fix(encryption): deprecate deriving the passwords of a key set beyond…
Spomky Nov 29, 2026
75215eb
Merge pull request #830 from web-token/fix/aes-gcm-wrapped-key-size
Spomky Nov 29, 2026
a5eea10
Merge pull request #831 from web-token/fix/pbes2-key-set-iterations
Spomky Nov 29, 2026
06d3de8
Merge the RSA operations through OpenSSL fix into 4.2.x
Spomky Nov 29, 2026
382f6e1
ci: add to the PHPStan baseline the error symfony/dependency-injectio…
Spomky Nov 29, 2026
a9b96a7
Merge release 4.2.9 into 4.3.x
Spomky Nov 29, 2026
0378780
Merge pull request #833 from web-token/4.2.x-merge-up-into-4.3.x_ZkUg…
Spomky Nov 29, 2026
8d4d0dd
fix(okp): refuse the Ed25519 public keys of small order without sodium
lav45 Nov 10, 2026
a1a5c83
fix(key-mgmt): report an Ed25519 key whose "x" is no valid public key
lav45 Nov 10, 2026
a7f5644
fix(okp): refuse the Ed448 public keys of small order
Spomky Nov 29, 2026
d63ca5b
fix(okp): decode an Ed25519 point with a single exponentiation
Spomky Nov 29, 2026
b1cdeac
Merge the head of #827 into fix/okp-ed448-small-order
Spomky Nov 29, 2026
1add176
Merge pull request #827 from lav45/fix/okp-ed25519-point-validation
Spomky Nov 29, 2026
fe4867b
Merge pull request #835 from web-token/fix/okp-ed448-small-order
Spomky Nov 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 75 additions & 3 deletions .ci-tools/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1434,6 +1434,12 @@ parameters:
count: 1
path: ../src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php

-
rawMessage: Cannot access offset 'allow_large_key_sets' on mixed.
identifier: offsetAccess.nonOffsetAccessible
count: 1
path: ../src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php

-
rawMessage: Cannot access offset 'client' on mixed.
identifier: offsetAccess.nonOffsetAccessible
Expand Down Expand Up @@ -1461,7 +1467,7 @@ parameters:
-
rawMessage: 'Cannot call method booleanNode() on mixed.'
identifier: method.nonObject
count: 1
count: 2
path: ../src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php

-
Expand All @@ -1479,13 +1485,13 @@ parameters:
-
rawMessage: 'Cannot call method end() on mixed.'
identifier: method.nonObject
count: 5
count: 6
path: ../src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php

-
rawMessage: 'Cannot call method info() on mixed.'
identifier: method.nonObject
count: 2
count: 3
path: ../src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php

-
Expand Down Expand Up @@ -4812,12 +4818,28 @@ parameters:
count: 1
path: ../src/Bundle/Helper/ConfigurationHelper.php

-
rawMessage: 'Parameter #2 $config of method Symfony\Component\DependencyInjection\ContainerBuilder::prependExtensionConfig() expects array<string, mixed>, array<mixed> given.'
identifier: argument.type
count: 1
path: ../src/Bundle/Helper/ConfigurationHelper.php

-
rawMessage: 'Parameter #2 ...$arrays of function array_merge expects array, mixed given.'
identifier: argument.type
count: 1
path: ../src/Bundle/Helper/ConfigurationHelper.php

-
rawMessage: '''
Access to constant on deprecated class Jose\Component\Encryption\Algorithm\KeyEncryption\RSA15:
since 4.3.0, will be removed in 5.0.0. The RSA1_5 algorithm moved to the "web-token/jwt-rsa15"
package: use Jose\Rsa15\KeyEncryption\RSA15 instead.
'''
identifier: classConstant.deprecatedClass
count: 1
path: ../src/Bundle/Resources/config/Algorithms/encryption_rsa15.php

-
rawMessage: '''
Access to constant on deprecated class Jose\Component\Signature\Algorithm\EdDSA:
Expand All @@ -4838,6 +4860,16 @@ parameters:
count: 1
path: ../src/Bundle/Resources/config/Algorithms/signature_experimental.php

-
rawMessage: '''
Access to constant on deprecated class Jose\Component\Signature\Algorithm\None:
since 4.3.0, will be removed in 5.0.0. The "none" algorithm moved to the "web-token/jwt-unsecured"
package: use Jose\Unsecured\Signature\None instead.
'''
identifier: classConstant.deprecatedClass
count: 1
path: ../src/Bundle/Resources/config/Algorithms/signature_none.php

-
rawMessage: Access to constant on internal class Jose\Component\Core\Util\Ecc\NistCurve.
identifier: classConstant.internalClass
Expand Down Expand Up @@ -5972,6 +6004,12 @@ parameters:
count: 1
path: ../src/Library/Encryption/Serializer/JSONFlattenedSerializer.php

-
rawMessage: 'Only booleans are allowed in a ternary operator condition, mixed given.'
identifier: ternary.condNotBoolean
count: 1
path: ../src/Library/Encryption/Serializer/JSONFlattenedSerializer.php

-
rawMessage: 'Parameter #1 $encodedString of static method Jose\Component\Core\Util\Base64UrlSafe::decodeNoPadding() expects string, mixed given.'
identifier: argument.type
Expand Down Expand Up @@ -6038,6 +6076,12 @@ parameters:
count: 1
path: ../src/Library/Encryption/Serializer/JSONGeneralSerializer.php

-
rawMessage: 'Only booleans are allowed in a ternary operator condition, mixed given.'
identifier: ternary.condNotBoolean
count: 1
path: ../src/Library/Encryption/Serializer/JSONGeneralSerializer.php

-
rawMessage: 'Parameter #1 $encodedString of static method Jose\Component\Core\Util\Base64UrlSafe::decodeNoPadding() expects string, mixed given.'
identifier: argument.type
Expand Down Expand Up @@ -6116,6 +6160,12 @@ parameters:
count: 1
path: ../src/Library/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php

-
rawMessage: 'Only booleans are allowed in an if condition, mixed given.'
identifier: if.condNotBoolean
count: 1
path: ../src/Library/KeyManagement/Analyzer/MixedPublicAndPrivateKeys.php

-
rawMessage: 'Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.'
identifier: argument.type
Expand All @@ -6128,6 +6178,17 @@ parameters:
count: 1
path: ../src/Library/KeyManagement/Analyzer/ZxcvbnKeyAnalyzer.php

-
rawMessage: '''
Class Jose\Component\KeyManagement\JKUFactory extends deprecated class Jose\Component\KeyManagement\UrlKeySetFactory:
since 4.3.0 and will be removed in 5.0.0. Use JKUFactory or X5UFactory and type against them, or write
a factory of your own: an HTTP client is all that is needed to fetch the document. In 5.0.0, JKUFactory
and X5UFactory no longer extend this class.
'''
identifier: class.extendsDeprecatedClass
count: 1
path: ../src/Library/KeyManagement/JKUFactory.php

-
rawMessage: 'Parameter #1 $details of static method Jose\Component\KeyManagement\KeyConverter\RSAKey::createFromKeyDetails() expects array<mixed>, mixed given.'
identifier: argument.type
Expand Down Expand Up @@ -6224,6 +6285,17 @@ parameters:
count: 1
path: ../src/Library/KeyManagement/KeyConverter/RSAKey.php

-
rawMessage: '''
Class Jose\Component\KeyManagement\X5UFactory extends deprecated class Jose\Component\KeyManagement\UrlKeySetFactory:
since 4.3.0 and will be removed in 5.0.0. Use JKUFactory or X5UFactory and type against them, or write
a factory of your own: an HTTP client is all that is needed to fetch the document. In 5.0.0, JKUFactory
and X5UFactory no longer extend this class.
'''
identifier: class.extendsDeprecatedClass
count: 1
path: ../src/Library/KeyManagement/X5UFactory.php

-
rawMessage: 'Call to internal static method ParagonIE_Sodium_Core_Ed25519::publickey_from_secretkey().'
identifier: staticMethod.internal
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Target branch:
Resolves issue # <!-- #-prefixed issue number(s), if any -->
Resolves # <!-- #-prefixed issue number, if any; repeat the keyword for each issue: "Resolves #1, resolves #2" -->

<!-- replace space with "x" in square brackets: [x] -->
- [ ] It is a Bug fix
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/scorecards.yml

This file was deleted.

16 changes: 13 additions & 3 deletions src/Bundle/DependencyInjection/Source/KeyManagement/JKUSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,15 @@ public function load(array $configs, ContainerBuilder $container): void
$loader->load('jku_source.php');
$loader->load('jku_commands.php');
$container->setAlias('jose.http_client', $configs[$this->name()]['client']);
if (isset($configs[$this->name()]['follow_redirects'])) {
$followRedirects = $configs[$this->name()]['follow_redirects'] ?? null;
$allowLargeKeySets = $configs[$this->name()]['allow_large_key_sets'] ?? null;
if ($followRedirects !== null || $allowLargeKeySets !== null) {
foreach ([JKUFactory::class, X5UFactory::class] as $factory) {
$container->getDefinition($factory)
->addArgument($configs[$this->name()]['follow_redirects']);
$definition = $container->getDefinition($factory)
->addArgument($followRedirects);
if ($allowLargeKeySets !== null) {
$definition->addArgument($allowLargeKeySets);
}
}
}
}
Expand All @@ -49,6 +54,11 @@ public function getNodeDefinition(NodeDefinition $node): void
->info('HTTP Client used to retrieve key sets.')
->isRequired()
->end()
->booleanNode('allow_large_key_sets')
->info(
'True loads the key sets of more than 4096 JSON values, false refuses them. When it is not set, they are loaded with a deprecation, as 5.0.0 refuses them by default.'
)
->end()
->booleanNode('follow_redirects')
->info(
'False refuses the redirects of the key set URLs, true follows them. When it is not set, they are followed with a deprecation, as 5.0.0 refuses them by default.'
Expand Down
4 changes: 2 additions & 2 deletions src/Bundle/EnvVarProcessor/KeyEnvVarProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public function getEnv(string $prefix, string $name, Closure $getEnv): mixed
$env = $getEnv($name);

return match ($prefix) {
'jwk' => JWK::createFromJson($env),
'jwkset' => JWKSet::createFromJson($env),
'jwk' => JWK::createFromJson($env, true),
'jwkset' => JWKSet::createFromJson($env, true),
default => throw new RuntimeException(sprintf('Unsupported prefix "%s".', $prefix)),
};
}
Expand Down
8 changes: 8 additions & 0 deletions src/Bundle/Resources/config/Algorithms/encryption_rsa15.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Jose\Component\Encryption\Algorithm\KeyEncryption\RSA15 as LibraryRSA15;
use Jose\Rsa15\KeyEncryption\RSA15;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

Expand All @@ -16,4 +17,11 @@
->tag('jose.algorithm', [
'alias' => 'RSA1_5',
]);

$container->set(LibraryRSA15::class)
->deprecate(
'web-token/jwt-framework',
'4.3.0',
'The "%service_id%" service is deprecated and will be removed in 5.0.0: the "RSA1_5" algorithm is now shipped by the "web-token/jwt-rsa15" package and registered as "' . RSA15::class . '", under the same "RSA1_5" alias.'
);
};
8 changes: 8 additions & 0 deletions src/Bundle/Resources/config/Algorithms/signature_none.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Jose\Component\Signature\Algorithm\None as LibraryNone;
use Jose\Unsecured\Signature\None;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

Expand All @@ -16,4 +17,11 @@
->tag('jose.algorithm', [
'alias' => 'none',
]);

$container->set(LibraryNone::class)
->deprecate(
'web-token/jwt-framework',
'4.3.0',
'The "%service_id%" service is deprecated and will be removed in 5.0.0: the "none" algorithm is now shipped by the "web-token/jwt-unsecured" package and registered as "' . None::class . '", under the same "none" alias.'
);
};
11 changes: 9 additions & 2 deletions src/Bundle/Resources/config/commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Jose\Component\Console\AddKeyIntoKeysetCommand;
use Jose\Component\Console\EcKeyGeneratorCommand;
use Jose\Component\Console\EcKeysetGeneratorCommand;
use Jose\Component\Console\GeneratorCommand;
use Jose\Component\Console\GetThumbprintCommand;
use Jose\Component\Console\KeyAnalyzerCommand;
use Jose\Component\Console\KeyFileLoaderCommand;
Expand All @@ -28,11 +29,17 @@
use Jose\Component\Console\RsaKeysetGeneratorCommand;
use Jose\Component\Console\SecretKeyGeneratorCommand;
use Jose\Component\Console\X509CertificateLoaderCommand;
use Jose\Component\KeyManagement\JWKFactoryInterface;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

return function (ContainerConfigurator $container): void {
$container = $container->services()
->defaults()
$services = $container->services();

$services->instanceof(GeneratorCommand::class)
->call('setJwkFactory', [service(JWKFactoryInterface::class)]);

$container = $services->defaults()
->private()
->autoconfigure()
->autowire();
Expand Down
2 changes: 1 addition & 1 deletion src/Bundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"symfony/event-dispatcher": "^7.0|^8.0",
"symfony/http-client-contracts": "^3.4",
"symfony/http-kernel": "^7.0|^8.0",
"web-token/jwt-library": "^4.0"
"web-token/jwt-library": "^4.3"
},
"suggest": {
"symfony/serializer": "Use the Symfony serializer to serialize/unserialize JWS and JWE tokens.",
Expand Down
2 changes: 1 addition & 1 deletion src/Experimental/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"require": {
"php": ">=8.2",
"ext-openssl": "*",
"web-token/jwt-library": "^4.0"
"web-token/jwt-library": "^4.3"
}
}
4 changes: 2 additions & 2 deletions src/Library/Console/AddKeyIntoKeysetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function getKeyset(InputInterface $input): JWKSet
if (! is_string($jwkset)) {
throw new InvalidKeySetException('The argument must be a valid JWKSet.');
}
$json = JsonConverter::decode($jwkset);
$json = JsonConverter::decode($jwkset, true);
if (! is_array($json)) {
throw new InvalidKeySetException('The argument must be a valid JWKSet.');
}
Expand All @@ -61,7 +61,7 @@ private function getKey(InputInterface $input): JWK
if (! is_string($jwk)) {
throw new InvalidKeyException('The argument must be a valid JWK.');
}
$json = JsonConverter::decode($jwk);
$json = JsonConverter::decode($jwk, true);
if (! is_array($json)) {
throw new InvalidKeyException('The argument must be a valid JWK.');
}
Expand Down
3 changes: 2 additions & 1 deletion src/Library/Console/EcKeyGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
}
$args = $this->getOptions($input);

$jwk = $this->jwkFactory->ec($curve, $args);
$jwk = $this->getJwkFactory()
->ec($curve, $args);
$this->prepareJsonOutput($input, $output, $jwk);

return self::SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion src/Library/Console/EcKeysetGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$keyset = new JWKSet([]);
for ($i = 0; $i < $quantity; ++$i) {
$args = $this->getOptions($input);
$keyset = $keyset->with($this->jwkFactory->ec($curve, $args));
$keyset = $keyset->with($this->getJwkFactory()->ec($curve, $args));
}
$this->prepareJsonOutput($input, $output, $keyset);

Expand Down
Loading
Loading