Skip to content

AI junk#430

Closed
Devil1716 wants to merge 1 commit into
pallets:mainfrom
Devil1716:fix/429-reject-unexpected-loads-kwargs
Closed

AI junk#430
Devil1716 wants to merge 1 commit into
pallets:mainfrom
Devil1716:fix/429-reject-unexpected-loads-kwargs

Conversation

@Devil1716

Copy link
Copy Markdown

Summary

  • Remove unused **kwargs from Serializer.loads so unexpected arguments like max_age raise TypeError instead of being silently ignored on non-timed serializers.
  • This closes a footgun where swapping URLSafeTimedSerializer for URLSafeSerializer while still passing max_age would accept expired tokens forever.

Test plan

  • pytest tests/test_itsdangerous/ — 305 passed, 4 skipped
  • New test asserts URLSafeSerializer.loads(..., max_age=-1) raises TypeError; timed serializers still accept max_age

fixes #429

Made with Cursor

Untimed serializers previously swallowed max_age via unused **kwargs,
so swapping URLSafeTimedSerializer for URLSafeSerializer could silently
accept expired tokens. Raise TypeError instead.

Fixes pallets#429

Co-authored-by: Cursor <cursoragent@cursor.com>
@ThiefMaster

Copy link
Copy Markdown
Member

https://palletsprojects.com/contributing/llm-ai

If you are a new contributor, do not use LLM or AI tools to contribute at all; you do not have the trust or experience to take responsibility for what is generated.

@davidism davidism changed the title Reject unexpected kwargs in Serializer.loads AI junk Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URLSafeSerializer.loads silently ignores unexpected max_age argument

2 participants