Check a change for security problems
Look at a change for injection, leaked secrets and missing permission checks.
Engineering · Software · When you ask · Updated
Works with
- Slack
How do you run a security code review with AI?
To run a security code review with AI, mention Maito in Slack with the branch name. It reads the changed files and their callers, checks for injection, leaked secrets and missing permission checks, then replies with findings ranked by severity, the line for each, and a suggested patch you can review.
How it's done today
Security review happens only for big releases.
What Maito does
- Read the change
- Check for common security mistakes
- Report what's risky and how to fix it
Example
@Maito security-review the new file upload endpoint on branch feat/uploads before Thursday's release.
One high, one medium. Everything else in the diff (auth check, size limit, signed URLs) looks right. High: routes/uploads.ts line 37 trusts the Content-Type header. An .html file sent as image/png is stored and served from app.northstar.example, so a script inside it runs with a logged-in user's session. Medium: the original filename goes into the storage key unchanged, so a name like ../../avatars/ceo.png can overwrite another file. Suggested fix: check the real file type from its first bytes, store under a generated ID, serve uploads from a separate domain. Attached: uploads-fix.patch (not applied). I read the changed files and their callers only. Worth a look from your security lead before release. Want me to apply the patch on a branch and open a PR?
Alex (1:12 PM):
security-review the new file upload endpoint on branch feat/uploads before Thursday's release.
Maito (1:31 PM):
One high, one medium. Everything else in the diff (auth check, size limit, signed URLs) looks right.
High: routes/uploads.ts line 37 trusts the Content-Type header. An .html file sent as image/png is stored and served from app.northstar.example, so a script inside it runs with a logged-in user's session.
Medium: the original filename goes into the storage key unchanged, so a name like ../../avatars/ceo.png can overwrite another file.
Suggested fix: check the real file type from its first bytes, store under a generated ID, serve uploads from a separate domain. Attached: uploads-fix.patch (not applied).
I read the changed files and their callers only. Worth a look from your security lead before release.
Want me to apply the patch on a branch and open a PR?
How to set it up
- Set up
Nothing to set up. Ask in Slack or by email whenever you need it.
What it won't do
It reads the diff and its callers, not the whole system, so problems that depend on infrastructure or other services can go unseen. A person on your team still signs off on the release.
Questions
Only if you ask. It attaches a suggested patch first. Applying it on a branch and opening a pull request happens after you say yes.
The changed files and the code that calls them. It tells you that scope in the reply, so you know what was not checked.
No. It catches common problems early and gives your security lead a shorter list to look at before release.