AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 39 Bitcoin

chore: bump to pydantic 2 (#4253)

Public commit record

What the developer wrote

Authored by Vlad Stan

65/100 · Adequate
chore: bump to pydantic 2 (#4253)
✓ Descriptive subject✓ Names a concrete action or component✓ Uses a recognizable type or scope✓ Links an issue, advisory, or supporting reference! No meaningful explanatory body
The short version

What changed, and why it matters

This is a large dependency upgrade from Pydantic 1 to Pydantic 2 across the LNbits project. Most changes are mechanical renames (e.g., dict() to model_dump(), parse_obj() to model_validate()). A few small functional changes are mixed in: invoice creation now explicitly rejects missing amounts, daily withdrawal limit checks are paginated and abort on shutdown, JWT account lookup now checks usr before sub, and validation error responses no longer include raw user input. The commit does not describe itself as a security fix, but the upgrade removes a known Pydantic 1 validator cache workaround and may affect input validation behavior across the API.

Recommended action

Treat this as a high-risk dependency migration. Run the full test suite, add differential tests comparing Pydantic 1 and 2 validation outcomes for security-critical models (payments, invoices, auth payloads, onchain PSBTs, scheduler policies), and review any extension code not covered by the core diff. Pay special attention to the JWT claim ordering change and the new explicit amount checks to ensure no unintended access or business-logic regressions.

Security signals we found

01

Dependency major-version upgrade (Pydantic 1 -> 2) with broad validation behavior changes

02

Removal of Pydantic v1 duplicate-validator cache workaround in extension route registration

03

JWT account resolution reordered to prefer 'usr' claim over 'sub' claim

04

Validation error handler now strips raw user input from error responses to avoid leaking input data

05

Invoice creation now explicitly rejects missing amount, closing a potential Pydantic 2 coercion gap

06

Daily withdraw limit loop now aborts on shutdown instead of continuing with partial results

07

User cache clearing now includes inactive users (active_only=False change)

Risk score

Why this scored 39/100

Our methodology →
Potential impact 8/30
Exploitability 7/25
Stealth signal 5/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.