Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (deps): bump jwcrypto from 1.3.1 to 1.4.2 #152

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 15, 2022

Bumps jwcrypto from 1.3.1 to 1.4.2.

Release notes

Sourced from jwcrypto's releases.

Version 1.4.2

Another minor release to fix a mistake in the compatibility heuristics which affects actual applications

What's Changed

New Contributors

Full Changelog: latchset/jwcrypto@v1.4.1...v1.4.2

Version 1.4.1

This is a minor release focused on improving backwards compatibility with applications after the API breaking changes introduced in 1.4 This patch adds a bunch of heuristics to be able to safely autodetect a token type. It has been tested to solve the compatibility issues (ie old code works without modifications and fully securely) with at least one large application.

What's Changed

Full Changelog: latchset/jwcrypto@v1.4.0...v1.4.1

Version 1.4

This is a security release to address CVE-2022-3102.

The JWT code can auto-detect the type of token being provided, and this can lead the application to incorrect conclusions about the trustworthiness of the token. Quoting the private disclosure we received : "Under certain circumstances, it is possible to substitute a [..] signed JWS with a JWE that is encrypted with the public key that is normally used for signature validation." This substitution attack can occur only if the validating application also have access to the private key, normally used to sign the tokens, available during validation of the received JWT. The significance of this attacks depends on the use of the token, it may lead to authentication bypass or authorization bypass (respectively if claims are used to authenticate or authorize certain actions), because the attacker has full control of the data placed in the JWE and can inject any desired claim value.

Several mitigating factors exist that can protect applications from this issue:

  • If the private key corresponding to the public key used to encrypt the JWE is not available to the application an exception will be raised.
  • If the JWK is specified with the 'use' parameter set to 'sig' (as expected for keys used only for signing/verification) an exception will be raised.
  • If the JWK is specified with the 'key_ops' parameter set and it does not include the 'decrypt' operation an exception will be raised.
  • Applications may check the token type before validation, in this case they would fail to detect an expected JWS

Normally, signing and validation are done by different applications, so this scenario should be unlikely. However it is possible to have applications that both sign and validate tokens and do not separate JWKs in use, or do not set a JWK 'use' type.

Due to the mitigating factors, and the fact that specific operational constraints and conditions need to be in place to successfully exploit this issue to generate an authentication bypass, we rate this security issue as moderate. Other avenues may decide on a different rating based on use case, always verify what conditions apply to your use of the library to assess risk.

Many thanks to Tom Tervoort of Secura for finding and reporting this issue.

Important Note

In order to address this security issue certain changes had to be made that may make this update incompatible with some existing applications. Namely, a new 'expect_type' argument has been added to JWT; this argument now defaults to 'JWS' if not explicitly set unless a non default set of algorithms that include exclusively non-signing algorithms is set. In that case the default is switched to 'JWE', this is done to be as much backwards compatible as possible with any hint we are provided.

If the token passed to JWT for validation is not of the 'expected' type, an exception will be raised on validation. Note that a token can be de-serialized w/o validation by not providing a key at the time of de-serialization. This operation will continue to work regardless of expected type. The expectation apply exclusively at validation time. This is intentional as it allows applications that were de-serializing and then checking the type of token to keep working or do so with minimal modifications.

For applications that need more time to update there is a 'born-deprecated' module level variable that can be set to restore the old behavior and disregard expectations. See the jwcrypto jwt module documentation under the variables section for more details about that.

... (truncated)

Commits
  • 83ab6cb Version 1.4.2
  • a7b2136 Add tests for algos heuristics
  • 6995447 Fix typo in new backwards JWT compat heuristics
  • 54618cc Version 1.4.1
  • c4e0bee Add more heuristics for backwards JWT compat
  • 84f121f Version 1.4
  • 34b6525 Add global workaround for applications
  • f4e912f Make JWT require to know what to expect
  • 5a13cfc Add support for RFC 9278: JWK Thumbprint URI
  • e5c1e42 Upgrade GitHub Actions
  • See full diff in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [jwcrypto](https://github.com/latchset/jwcrypto) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/latchset/jwcrypto/releases)
- [Commits](latchset/jwcrypto@v1.3.1...v1.4.2)

---
updated-dependencies:
- dependency-name: jwcrypto
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot requested a review from a team as a code owner September 15, 2022 17:30
@dependabot dependabot bot added the dependencies Pull requests that update dependencies label Sep 15, 2022
@dependabot dependabot bot changed the base branch from main to dev November 4, 2022 15:24
@afeld afeld merged commit 5ee5c1b into dev Nov 15, 2022
@afeld afeld deleted the dependabot/pip/jwcrypto-1.4.2 branch November 15, 2022 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update dependencies
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant