Skip to content

Commit 6edae7d

Browse files
committed
docs: mark issue #31 as complete
1 parent ea852df commit 6edae7d

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

SECURITY-REVIEW.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,12 +526,17 @@
526526

527527
### 31. Missing Max Length on Token Refresh Schema
528528

529+
> [!NOTE]
530+
> **Done**: Added `max_length=1024` to refresh token field, matching
531+
> MAX_JWT_TOKEN_LENGTH. This provides defense-in-depth validation with
532+
> Pydantic catching oversized tokens at schema level. See PR #818.
533+
529534
**Location**: `app/schemas/request/auth.py:6-9`
530535

531-
- **Issue**: Refresh token field has no length validation in schema. While the
532-
endpoint validates format (auth.py:174-181), the schema itself has no
536+
- **Issue**: Refresh token field had no length validation in schema. While the
537+
endpoint validated format (auth.py:174-181), the schema itself had no
533538
constraints.
534-
- **Fix**: Add `max_length` and `min_length` to schema for defense in depth.
539+
- **Fix**: Add `max_length` to schema for defense in depth.
535540

536541
### 32. Bcrypt Work Factor Not Configurable
537542

app/schemas/request/auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
from pydantic import BaseModel, EmailStr, Field
44

5+
from app.managers.helpers import MAX_JWT_TOKEN_LENGTH
6+
57

68
class TokenRefreshRequest(BaseModel):
79
"""Request schema for refreshing a JWT token."""
810

911
refresh: str = Field(
1012
...,
11-
max_length=1024,
13+
max_length=MAX_JWT_TOKEN_LENGTH,
1214
description="JWT refresh token",
1315
)
1416

0 commit comments

Comments
 (0)