You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a3b2a1
Browse filesBrowse the repository at this point in the historyBrowse files
Forgotten guards in Express, Python and Spring, an API's callers, and records returned whole
Routes beside a guarded one. Rules for Express, FastAPI and Flask, and
Spring mark every route handler with no guard semgrep can see. Triage
reads the rest: a guard on the route (middleware, Depends on a sign in
check, @login_required, @PreAuthorize, an inline middleware that calls
one), one over the whole router or app (router.use, router dependencies,
include_router, an auth middleware, a before_request that refuses,
anyRequest().authenticated()), or a path public by design. What is left
is kept for a person only when another route in the same file is guarded
and it is not; a file of routes none of which ask for a sign in is
advisory. Comments are blanked before a route's arguments are read, so an
apostrophe in a handler cannot hide its guard, and a security headers or
session middleware is never taken for a sign in check.
Checked on 24 repositories here: 763 handlers cleared, 167 advisory, and
the rest kept were routers that mix guarded and unguarded routes. On this
product's own code, every route but one is cleared; the one is a route that
checks the session itself on purpose.
An API's callers. The browser scan of a site now reads, from its scripts,
the calls its pages make to other sites on the list: the API base in the
app's configuration and the names joined to it, with parameter names kept
and values dropped. A scan of one of those sites starts from them, and
counts them as routes its code declares. Hosts not on the list are never
kept.
Records returned whole. The reasoning pass asks one small question about
each handler that looks a record up from the request and returns it as it
is, with the class it returns beside it: whether it hands over other
people's contact details or keys, staff fields or an IP address. Found in
code for nothing, C# and Java included, at most 15 a repository, each
cached against the code and filed only when the second look agrees. A new
data-exposure category, and a switch on the AI page, on by default.
0 commit comments