Free Packagev1.27.0
shieldci/laravel v1.27.0
Changed
- •
maintenance-mode-statusasks Laravel whether the application is down, so cache-driver and relocated-storage outages are reported, which can fail a defaultfail_on: highbuild (#742) - •
maintenance-mode-statuswarns at Medium when the maintenance driver cannot answer, such as an unreachable cache store, instead of passing (#742) - •
maintenance-mode-statusno longer runs under--ci, since a CI checkout is never in maintenance mode (#742) - •
logic-in-routesgrades a complex read such asPost::whereIn('id', $ids)->get()Medium instead of High (#752) - •
logic-in-routesreportsrestore()as a database write, which can fail a defaultfail_on: highbuild (#752) - •
logic-in-routesanalyses closures on routes registered through a chain such asRoute::middleware(),prefix()orname(), which can fail a defaultfail_on: highbuild (#753) - •
logic-in-routesgrades static job dispatch,Artisanfacade calls andnotify()as business logic, which can fail a defaultfail_on: highbuild (#756) - •
logic-in-routescounts writes through?->, relation methods such assync(), the signed-in user such asauth()->user()->update()and property hops, which can fail a defaultfail_on: highbuild (#757) - •
logic-in-routescounts further Eloquent writes, such ascreateMany(),forceCreate(),updateOrFail()andsaveQuietly(), which can fail a defaultfail_on: highbuild (#757) - •
logic-in-routescounts writes on a models-namespace class named like a utility, such asApp\Models\File::create(), which can fail a defaultfail_on: highbuild (#757) - •
logic-in-routesgrades a collectionpush($value)or a first-class callable such as->delete(...)on a model chain Medium instead of High (#757) - •
mass-assignment-vulnerabilitiesreports#[Unguarded]and#[Guarded([])]Critical on a directModelorAuthenticatablesubclass with no fillable columns, which can fail a defaultfail_on: highbuild (#762) - •
logic-in-routesmatches Eloquent write methods regardless of case, such as->Delete(), which can fail a defaultfail_on: highbuild (#770) - •
logic-in-routesreports writes in query callbacks, on route-bound models,Auth::guard('api')->user(),Request::user()and model collections, which can fail a defaultfail_on: highbuild (#778) - •
logic-in-routesreports reads on route-bound models andRequest::user(), such asfn (Post $post) => $post->comments()->get(), at Low whenallow_simple_readsis off (#778) - •
logic-in-routesadds the newly detected write or business logic to an already-reported closure's message, which changes its fingerprint (#756, #757, #770, #778) - •
logic-in-routesgives a regraded closure, such as awhereIn()read chain or a closure that is only aDB::table()read, a new message, which changes its fingerprint (#752, #788) - •
logic-in-routesreads route files underroutes/that the configured paths leave out, which can fail a defaultfail_on: highbuild (#794) - •
logic-in-routesreports a route file that cannot be parsed or read as a Low issue instead of passing (#794) - •
sql-injectionrecognises$request?->input()and the other nullsafe$request?->reads as user input, which can fail a defaultfail_on: highbuild (#797)
Fixed
- •
logic-in-routesgrades a route closure that is one read chain, such asfn () => Post::paginate(15), as a read instead of High business logic (#752) - •
logic-in-routesno longer grades a bareapp()call that reads application information, such asapp()->getLocale(), as business logic (#755) - •
logic-in-routesno longer grades a models-namespace class named like a facade, such asApp\Models\Event::find(1), as a facade call (#757) - •
mass-assignment-vulnerabilitiesno longer reports a model that declares neither$fillablenor$guarded, since the baseModelalready guards every attribute (#762) - •
mass-assignment-vulnerabilitiesreads Eloquent attributes such as#[Fillable]through the file's imports, so an aliased import counts and anApp\Attributes\Fillabledoes not (#762) - •
mass-assignment-vulnerabilitiesreads only the leading array of#[Fillable], as Laravel does, so#[Fillable(['name'], 'password')]lists onlyname(#762) - •
mass-assignment-vulnerabilitiesno longer reports$guarded = []beside a non-empty fillable list, or on a model extendingPivotorMorphPivot(#762) - •
mass-assignment-vulnerabilitieshonours$visibleand#[Visible], so a sensitive field the allow-list leaves out is not reported as unhidden (#762) - •
mass-assignment-vulnerabilitiesno longer checks$hiddenon a model extending a project base class, unless the model declares its own (#762) - •
logic-in-routesno longer treats a*Modelclass declared underapp/without extending Eloquent, such as a view model, as an Eloquent model (#771) - •
logic-in-routesno longer grades a non-query static call such asDashboardViewModel::make()on an unreadable*Modelclass as business logic, unless the closure writes (#771) - •
logic-in-routesgrades a read with awhereHas()orwhen()query callback, or an eager-load constraint, as a read instead of business logic (#778) - •
logic-in-routesgrades local scopes named like collection methods, such asArticle::filter(), as reads (#778) - •
logic-in-routesgrades reads on a route-bound model,auth()->guard('api')->user()orRequest::user()as reads (#778) - •
logic-in-routesgrades a closure that only assigns plain values or reads and returns a read, directly or throughview(), as that read (#778) - •
logic-in-routesgradescache()andsession()helper chains like their facade forms (#778) - •
logic-in-routesno longer gradeswhereIn()on an in-memory collection as a database query (#778) - •
shield:baselinecreates a missing baseline directory, and reports a file it cannot write with an error and exit 1 instead of an uncaughtErrorException(#786) - •
logic-in-routesgrades a closure that is only aDB::table()read like the same read on a model, instead of High raw database queries (#788) - •
phpstanandcollection-call-optimizationrun PHPStan withlaravel/paodisabled, soshield:analyzeinside an AI coding agent no longer passes with no findings (#792) - •
phpstanandcollection-call-optimizationreport an error instead of passing when PHPStan prints JSON that is not its report (#792) - •
phpstanandcollection-call-optimizationquote an error PHPStan reports outside any file as a 500-character excerpt when longer, instead of the whole text (#793) - •
phpstanandcollection-call-optimizationkeepshieldci.excluded_pathsout of the PHPStan run unless the project config usesexcludes_analyse, so an unparseable excluded file no longer stops it (#795) - •
phpstanandcollection-call-optimizationleave Blade templates out of the PHPStan run, so a template PHPStan cannot parse no longer stops it (#795) - •
phpstanno longer reports findings inside Blade templates, which PHPStan reads as plain PHP (#795) - •
phpstanandcollection-call-optimizationreturn Skipped when every analysed path is excluded or holds only Blade templates, instead of analysing those files anyway (#795)