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

⬆️(dependencies) update PyJWT to v2.10.1 [SECURITY] #262

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 2, 2024

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
PyJWT ==2.10.0 -> ==2.10.1 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2024-53861

Summary

The wrong string if check is run for iss checking, resulting in "acb" being accepted for "_abc_".

Details

This is a bug introduced in version 2.10.0: checking the "iss" claim
changed from isinstance(issuer, list) to isinstance(issuer, Sequence).

-        if isinstance(issuer, list):
+        if isinstance(issuer, Sequence):
            if payload["iss"] not in issuer:
                raise InvalidIssuerError("Invalid issuer")
        else:

Since str is a Sequnce, but not a list, in is also used for string
comparison. This results in if "abc" not in "__abcd__": being
checked instead of if "abc" != "__abc__":.

PoC

Check out the unit tests added here: https://github.com/jpadilla/pyjwt-ghsa-75c5-xw7c-p5pm

        issuer = "urn:expected"

        payload = {"iss": "urn:"}

        token = jwt.encode(payload, "secret")

        # decode() succeeds, even though `"urn:" != "urn:expected". No exception is raised.
        with pytest.raises(InvalidIssuerError):
            jwt.decode(token, "secret", issuer=issuer, algorithms=["HS256"])

Impact

I would say the real world impact is not that high, seeing as the signature still has to match. We should still fix it.


Release Notes

jpadilla/pyjwt (PyJWT)

v2.10.1

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added dependencies Pull requests that update a dependency file noChangelog labels Dec 2, 2024
@renovate renovate bot force-pushed the renovate/pypi-pyjwt-vulnerability branch 2 times, most recently from 9934c0c to c630807 Compare December 3, 2024 00:32
@renovate renovate bot force-pushed the renovate/pypi-pyjwt-vulnerability branch 11 times, most recently from bfe8e92 to 105125d Compare December 9, 2024 17:20
@renovate renovate bot force-pushed the renovate/pypi-pyjwt-vulnerability branch 8 times, most recently from 2328336 to fd4ea28 Compare December 17, 2024 09:20
@renovate renovate bot force-pushed the renovate/pypi-pyjwt-vulnerability branch from fd4ea28 to 57b6fd3 Compare December 17, 2024 10:35
@lebaudantoine lebaudantoine merged commit c0d101a into main Dec 17, 2024
10 of 11 checks passed
@lebaudantoine lebaudantoine deleted the renovate/pypi-pyjwt-vulnerability branch December 17, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file noChangelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant