Skip to content

fix: SQL identifier injection - #302

Merged
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:techmahedy-4.x
Sep 8, 2026
Merged

fix: SQL identifier injection#302
techmahedy merged 1 commit into
doppar:4.xfrom
techmahedy:techmahedy-4.x

Conversation

@techmahedy

Copy link
Copy Markdown
Member

Summary

Three security fixes for the ORM/query layer, found during a framework-wide review:

  • Session fixation: Authenticate::setUser() now regenerates the session ID on every login path (fresh login, 2FA completion, remember-cookie resume) before writing the auth key.
  • Mass-assignment on update: save()-as-update and update() previously skipped the $creatable whitelist filter entirely when a model didn't declare $creatable (only insert enforced it). Both paths now require $creatable to be declared, matching insert's existing guarantee.
  • SQL identifier injection: where(), orderBy(), groupBy(), whereIn(), whereBetween(), whereNull(), whereLike(), and the whereDate/whereMonth/whereYear/whereDay/whereTime helpers interpolated column names (and orderBy's direction) into SQL with no validation — only values were bound. Added a strict identifier allowlist (column or table.column) validated at each entry point, across both query builder classes (Entity\Builder and Entity\Query\Builder). whereRaw()/orderByRaw()/groupByRaw() remain the unchanged, intentional raw-SQL escape hatch.

@techmahedy
techmahedy merged commit b0ba939 into doppar:4.x Sep 8, 2026
16 checks passed
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.

1 participant