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): update dependency pyjwt to v2.10.1 [security] #697

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 6, 2024

This PR contains the following updates:

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

Review

  • Updates have been tested and work
  • If updates are AWS related, versions match the infrastructure (e.g. Lambda runtime, database, etc.)

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 - "" in timezone America/Montreal, 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 force-pushed the renovate/pypi-pyjwt-vulnerability branch 2 times, most recently from d40b9fd to f5b0356 Compare December 16, 2024 18:32
@renovate renovate bot force-pushed the renovate/pypi-pyjwt-vulnerability branch from f5b0356 to 8eeac41 Compare December 17, 2024 21:43
@sylviamclaughlin sylviamclaughlin merged commit 6afc29e into main Dec 17, 2024
6 checks passed
@sylviamclaughlin sylviamclaughlin deleted the renovate/pypi-pyjwt-vulnerability branch December 17, 2024 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant