packagist psalm/plugin-laravel v4.24.0

one day ago

Requires Psalm 7.22 or later. Taint analysis now reports request-chosen Eloquent relation names and Request::get() input.

Features

  • 🛡️ Add callable taint sinks to Eloquent relation-name parameters (with(), load(), whereHas(), withCount() and the rest of the eager-loading, existence and aggregate families): a name that is not a relation reaches Model::__call() and runs a Builder method, so ?include=truncate empties the table (GHSA-5wcm-3v2w-8362) (#2388)
 $query->with(explode(',', $request->input('include')));
+// TaintedCallable

Fixes

  • 🛡️ Mark Request::get() as a taint source. It was reported only when psalm/plugin-symfony was loaded, and Symfony 8 removes that method (#2394)
 return response('Results for '.$request->get('q'));
-// no issue
+// TaintedHtml
  • Keep * type arguments in filter() / whereNotNull() narrowing, higher-order proxies, keyBy() / groupBy(), factory count() and relation forwarding, so the result rejects the writes the receiver rejects (#2383)
 /** @param Collection<*, Post|null> $maybePosts */
 $maybePosts->whereNotNull();
-// Collection<array-key, Post>
+// Collection<*, Post>
  • Fix the ArgumentCountError from ClassLikeStorageProvider::addMore() that crashed every run on Psalm 7.22 (#2395)

Full Changelog: v4.23.3...v4.24.0

Don't miss a new plugin-laravel release

NewReleases is sending notifications on new releases.