Skip to content
Back to skills

Laravel Rust Audit

ASecurity

Security and correctness audit for Laravel for Rust apps (the laravel-rust crate). Use when asked to audit, security-review or check a Laravel for Rust codebase or pull request, covering record authorization, nested route scoping, broadcast channels, signed and resume links, raw SQL, shell commands and HTTP URLs, template escaping, models serialized to Inertia or JSON, uploads and file paths, login throttling, email verification, debug mode and secrets, trusted proxies, CSRF exclusions, publi...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentsrustgophpshellbashsqlgitapidatabasesecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 19 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add airshell/laravel-php-to-rust --skill laravel-rust-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Laravel Rust Audit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Laravel Rust Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/airshell-laravel-rust-audit/badge)](https://www.skillsdirectory.com/skills/airshell-laravel-rust-audit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laravel-rust-audit
description: Security and correctness audit for Laravel for Rust apps (the laravel-rust crate). Use when asked to audit, security-review or check a Laravel for Rust codebase or pull request, covering record authorization, nested route scoping, broadcast channels, signed and resume links, raw SQL, shell commands and HTTP URLs, template escaping, models serialized to Inertia or JSON, uploads and file paths, login throttling, email verification, debug mode and secrets, trusted proxies, CSRF exclusions, public cache headers, CORS, undeclared job and listener modules, workflow replay, blocking work, panics and dropped test fakes. Every Rust example compiles against laravel-rust 0.1.4, and the main claims were tested on that version. Not for writing new features (use the skills the app ships in .agents/skills/) or Laravel on PHP (use laravel-owasp-security).
license: MIT
metadata:
  author: airshell
  version: "1.0.4"
  laravelRustVersion: "0.1.x (tested 0.1.4)"
  rustVersion: "1.99+"
---

# Laravel for Rust Audit

Audit a [Laravel for Rust](https://laravel.com/rust) application for security holes and silent correctness bugs. Contains 26 rules across 9 categories. Every Rust example compiles against `laravel-rust` 0.1.4. Each "Tested" note in a rule records what a test, build or clippy run on that version showed.

**Version 1.0.4 (December 2026).** Laravel for Rust is in beta, and releases before 1.0 may change APIs. Read the docs bundled with the app's installed version before you report an API as wrong or missing.

## What This Skill Is For

New Laravel for Rust apps ship `AGENTS.md` and seven skills in `.agents/skills/` that teach agents how to **write** the app. None of them reviews or audits it. This skill does that: it finds what the compiler lets through.

- **Writing or changing features**: use the app's own skills (`writing-laravel-rust-apps` and the rest), with `laravel-rust-best-practices` for the mistakes that compile but behave wrongly
- **Laravel on PHP**: use `laravel-owasp-security`
- **Auditing a Laravel for Rust app or pull request**: use this skill

## When to Apply

- "Audit this app", "security review", "check this PR" on a project whose `Cargo.toml` depends on `laravel-rust`
- Before a release, or after an agent wrote a large part of the app
- Reviewing a change to routes, policies, input structs, channels, views, workflows or `src/app.rs`

## How to Audit

### Step 1: Confirm the stack and read the right docs

- `Cargo.toml` depends on `laravel-rust`; note the version from `Cargo.lock` (if the repository has none, see `audit-recon`)
- Run `.agents/skills/writing-laravel-rust-apps/scripts/docs-path.sh` and read `<docs>/documentation.md`, then the guide for each area you check. Name only APIs that exist in that version
- If arguments were given (`$ARGUMENTS`), audit only those files or features; otherwise the whole app

### Step 2: Map the attack surface

- `laravel route:list --json` (or `cargo run -- route:list --json`): every route with its middleware. Note which have `laravel::auth::middleware::Authenticate` and `laravel::session::forgery::PreventRequestForgery`, and recognise the framework's own routes (`audit-recon`)
- Read `src/routes/` for nested routes and `scope_bindings`, which `route:list` does not show, and `src/routes/channels.rs` for broadcast channels
- Read `src/app.rs`: middleware changes, `trust_proxies`, CSRF exclusions, guards
- Actors: guests, signed-in users, admins (roles on `User`), API clients (request guards), other tenants

### Step 3: Collect candidates

```bash
cargo clippy --all-targets -- -W clippy::unwrap_used -W clippy::expect_used -W clippy::let_underscore_must_use
```

Then run the searches in `audit-recon` and work through the categories below. Skip what the compiler already rejects (listed in `audit-recon`).

### Step 4: Prove, then report

- Gate each candidate with `audit-verdicts` (actor, input, control, boundary, result)
- Prove Confirmed findings with a `#[laravel::test]` on the test database where you can, or a complete source trace where you cannot (`audit-prove-with-tests`)
- Report with the template below

## Rule Categories by Priority

| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Audit Method | CRITICAL | `audit-` |
| 2 | Access Control | CRITICAL | `access-` |
| 3 | Input and Queries | CRITICAL | `input-` |
| 4 | Data Exposure | HIGH | `data-` |
| 5 | Authentication | HIGH | `auth-` |
| 6 | Configuration | HIGH | `config-` |
| 7 | Background Work | HIGH | `background-` |
| 8 | Runtime | MEDIUM | `runtime-` |
| 9 | Tests | MEDIUM | `test-` |

A rule's impact says how early to look. Grade each finding by what you demonstrated (`audit-verdicts`).

## Quick Reference

### 1. Audit Method (CRITICAL)

- `audit-recon` - Version, bundled docs, `route:list --json`, framework routes, clippy lints, searches, and what not to report
- `audit-verdicts` - Five-part gate, Confirmed / Needs validation / Hardening, severity by demonstrated result
- `audit-prove-with-tests` - Prove with `#[laravel::test]`; `acting_as` goes on the request; CSRF tests need `sec-fetch-site: cross-site`

### 2. Access Control (CRITICAL)

- `access-authorize-records` - `#[validate(authenticated)]` lets any user edit any record; reads need authorizing too
- `access-scope-nested-bindings` - `/users/{user}/posts/{post}` needs `scope_bindings` and a relationship
- `access-broadcast-channels` - A channel callback that returns `true` lets guests subscribe
- `access-signed-urls` - Signatures cover the URL, not the body; resume links act for whoever holds them

### 3. Input and Queries (CRITICAL)

- `input-raw-sql` - No user input in `AssertSqlSafe`; sort with an enum allow-list
- `input-laravel-extractors` - Axum `Form`/`Json`/`Query` skip validation and error handling
- `input-uploads` - Never `store_as` the client name; `image`/`mimes` check contents; no user input in `File::new` paths
- `input-shell-and-http-urls` - `Process::new` over `Process::shell(format!(..))`; `url_parameters` over `format!`
- `input-template-escaping` - No `|safe` or `Html::raw` on user input; `|tojson` only in single quotes

### 4. Data Exposure (HIGH)

- `data-serialize-models` - `props! { post }`, `Json(post)` and `data! { post }` send every column

### 5. Authentication (HIGH)

- `auth-throttle-login` - Atomic `rate_limit::attempt` on login; limits on registration, reset and verification
- `auth-verified-email` - `RequireVerifiedEmail` needs `MustVerifyEmail`; clear verification when the email changes

### 6. Configuration (HIGH)

- `config-debug-and-secrets` - `APP_DEBUG=false` in production; a leaked `APP_KEY` must not stay in `APP_PREVIOUS_KEYS`
- `config-trusted-proxies` - Not `"*"` unless the load balancer replaces `X-Forwarded-For`
- `config-csrf-exclusions` - Exclude only signed webhooks; watch `allow_same_site`; `GET` never writes
- `config-public-cache-headers` - No `CacheHeaders::public()` on responses that differ per user
- `config-cors-and-global-middleware` - No `Allowed::Any` origins with `credentials: true`; keep `TrustHosts`, `SecurityHeaders` and cookie encryption

### 7. Background Work (HIGH)

- `background-declare-modules` - A job or listener file without a `mod` line never runs, silently
- `background-workflow-replay` - Time and model columns inside steps, `ensure_successful`, idempotency keys, no renamed side-effect steps

### 8. Runtime (MEDIUM)

- `runtime-blocking-work` - `std::fs` and `std::thread::sleep` block the runtime; use `task::spawn_blocking` and `task::sleep`
- `runtime-panics-and-ignored-results` - `unwrap()` on input is a 500; `let _ = create!(..)` hides failed writes

### 9. Tests (MEDIUM)

- `test-bind-fakes` - `let _ = queue::fake()` drops the fake; the real job runs
- `test-deterministic` - No hardcoded IDs; read time with `laravel::now()`

## Report Template

```markdown
## Laravel for Rust Audit — <app>, laravel-rust <version>

### Scope
Routes reviewed, files read, what was not covered and why.

### Confirmed
**<Title> (<CRITICAL|HIGH|MEDIUM|LOW>)**
- Actor / input / control / boundary / result
- Evidence: `file:line`, and the test that proves it (or the source trace)
- Fix: the change at the decision point

### Needs validation
- <Candidate>. Missing fact: <what>. Check: <how>.

### Hardening
- <Best practice with nothing reaching it today>
```

## How to Use

Read individual rule files for the full explanation and the incorrect and correct code:

```
rules/audit-recon.md
rules/access-authorize-records.md
rules/input-raw-sql.md
```

Each rule file contains:
- Why it matters, and how to find candidates
- Incorrect code, with what happened when it was tested on 0.1.4
- Correct code
- References to the bundled guides

## References

- [Laravel for Rust](https://laravel.com/rust)
- [Laravel for Rust documentation](https://laravel.com/rust/docs)
- [laravel/rust skeleton](https://github.com/laravel/rust) (its `.agents/skills/`)
- [laravel-rust on crates.io](https://crates.io/crates/laravel-rust)
- [OWASP Top 10:2025](https://top10.owasp.org/2025/)

## Full Compiled Document

For the complete guide with all rules expanded: `AGENTS.md`

Files in this skill

  • AGENTS.md88.6 KB
  • README.md4.5 KB
  • SKILL.md9 KB
  • rules/_sections.md2 KB
  • rules/_template.md802 B
  • rules/access-authorize-records.md3.9 KB
  • rules/access-broadcast-channels.md2.6 KB
  • rules/access-scope-nested-bindings.md2.9 KB
  • rules/access-signed-urls.md3.5 KB
  • rules/audit-prove-with-tests.md3.4 KB
  • rules/audit-recon.md6.5 KB
  • rules/audit-verdicts.md4.6 KB
  • rules/auth-throttle-login.md4.5 KB
  • rules/auth-verified-email.md4.8 KB
  • rules/background-declare-modules.md3 KB
  • rules/background-workflow-replay.md4.7 KB
  • rules/config-cors-and-global-middleware.md4 KB
  • rules/config-csrf-exclusions.md4.4 KB
  • rules/config-debug-and-secrets.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.