Laravel Rust Production Security Checklist
A security checklist for taking a Laravel Rust application to production. Covers environment and secrets, CORS and headers, sessions, authentication, the framework's unsafe escape hatches, deployment and dependency audits. Based on the Laravel Rust 0.x beta docs.
Environment & Secrets
Laravel Rust runs as production when APP_ENV is unset, but set it explicitly. With APP_DEBUG=true, browsers receive a debug page with the error, its location, its chain of causes and the incoming request, and JSON errors include the type, file and line.
The key encrypts cookies and sessions. Anyone who has it can read encrypted values, forge cookies and create signed URLs. Generate it on the server with ./example-app key:generate --show and never reuse the key from your machine or another environment.
APP_URL decides whether session cookies get the Secure flag and which hosts the app will answer in production. An http:// value behind a TLS proxy means cookies without Secure.
Use env.require("STRIPE_KEY") or the required attribute so the application refuses to start when a secret is missing. A failed deploy is better than a handler that fails at run time.
The .env file is read from the app root and holds the encryption key and database password. Prefer real environment variables in production; they take precedence over .env.
List retired keys, comma-separated, in APP_PREVIOUS_KEYS so existing cookies and encrypted values still decrypt after a rotation. Rotate immediately if a key may have leaked.
CORS, Headers & CSRF
By default any origin may call routes under api/*, with any method and header. Set origins to Allowed::only([...]) with your real front-end origins.
Credentials with an unrestricted origin list lets any website call your API as the signed-in user. If you enable credentials, list exact origins.
The framework sets only X-Frame-Options: SAMEORIGIN and X-Content-Type-Options: nosniff. Add Strict-Transport-Security with max-age=31536000 in middleware or at your proxy.
No CSP is sent by default. Write the nonce middleware from the templates docs using view::use_csp_nonce, so Vite script and style tags carry the nonce, and send script-src with that nonce.
Neither is set by default. Use strict-origin-when-cross-origin and disable browser features you do not use, such as camera, microphone and geolocation.
PreventRequestForgery::new().except([...]) and without_middleware remove CSRF protection from routes. Exclude only routes called by other systems, and verify each with a signature.
Same-origin requests pass on the Sec-Fetch-Site header, but browsers do not send it over plain HTTP. Include csrf_field() in forms and the X-XSRF-TOKEN or X-CSRF-TOKEN header from JavaScript.
Sessions & Cookies
When SESSION_DRIVER is unset the driver falls back to cookie. With cookie sessions, a copied session cookie stays valid until it expires, so logging out cannot revoke it.
The example configuration has SESSION_ENCRYPT=false, so session payloads are stored in plain text in your database or Redis. Enable it if sessions contain anything sensitive.
Check the live response for Secure, HttpOnly and SameSite=Lax (or Strict). Secure is only set automatically when APP_URL is https.
Routes outside the web group, and global middleware, send cookies unencrypted and unsigned. Keep cookie-setting code on web routes and keep EncryptCookies::except to non-sensitive names.
Authentication & Authorisation
Nothing is throttled by default. Use the rate_limit::check, hit and clear pattern from the docs with Limit::per_minute(5), keyed on email and IP.
Add Throttle::per_minute to API routes. Counters use the default cache store, so use the database or Redis store in production so limits hold across instances.
There is no Sanctum equivalent. You write the request guard. Store a SHA-256 hash of each token, not the token, and implement expiry and revocation yourself.
Each input type must declare who may submit it, and anyone compiles. Confirm it appears only on genuinely public forms such as login and contact.
The compiler cannot detect IDOR. Use policies and user.authorize, and add tests that request another user's records and expect 403 or 404.
A workflow wait token is an identifier, not a secret. Anyone who can reach the route can resume the run unless you put authentication in front of it.
Code Escape Hatches
Run grep -rn "AssertSqlSafe\|db::sqlx" src/. AssertSqlSafe embeds a string in SQL verbatim with no bindings. Every use must be built from constants or an allowlist, never request input.
Output through {{ }} is escaped. The safe filter and with_html print raw HTML and are XSS if the content was not sanitised first.
tojson does not escape double quotes, so user data can break out of the attribute. Use the js filter for data in scripts.
The default scaffold is Inertia with React. React escapes by default, and dangerouslySetInnerHTML is the bypass.
Use the image or mimes rules, which inspect content; extensions checks only the filename. Store with .store(), which generates a random name, and never pass client_name to store_as.
Deployment & Network
The app listens on 127.0.0.1:8000 and does not handle TLS itself. Put a load balancer or reverse proxy in front, and if you set SERVER_HOST=0.0.0.0 in a container, make sure only the proxy can reach the port.
Use middleware.trust_proxies with your load balancer's address range. Without it, request.ip() is the load balancer and all users share one rate-limit key. Avoid "*" when a CDN sits in front of a load balancer.
In production the app answers only the APP_URL host and its subdomains. Send a request with a different Host header and check for 400. This is not enforced in local or testing.
Framework defaults are 2 MB bodies, 16 MB multipart and a 30-second handler timeout. Set matching or tighter limits and read timeouts at the proxy to protect against slow requests.
Reverb accepts WebSocket connections from any origin by default. Set REVERB_APP_ALLOWED_ORIGINS to your application's origins.
Migrations are compiled into the binary and production requires migrate --force. Run it once per deploy from the pipeline, not from application start-up on every instance.
OpenTelemetry tracing exports request paths and cache keys as written. Tokens in paths end up in your tracing backend.
Dependencies & Monitoring
cargo audit checks Cargo.lock against the RustSec advisory database. Schedule it as well, because advisories are published against code that has not changed.
The Inertia and React front end has its own dependency tree. Laravel Cloud's default build runs npm ci with auditing off, so do this in CI.
Laravel Rust is in beta and releases before 1.0 may change APIs and configuration. Stay on the latest 0.x release for security fixes and check each release for changed defaults.
Every response carries an X-Request-Id. Send errors to a tracker; Laravel Cloud's Issues feature does not capture Laravel Rust errors yet.
Check headers, CORS, cookie flags, TLS and exposed files on the live site after each deploy. StackShield's external scan covers these language-independent checks for Laravel Rust apps.
Frequently Asked Questions
Is Laravel Rust ready for production?
It is in beta. Laravel has said releases before 1.0 may include breaking changes and that it plans to call the framework stable after about six to eight weeks of feedback from its 1 December 2026 launch. It is reasonable for trials and low-risk services. For sensitive workloads, wait for 1.0 or do your own review.
What is the most important item on this checklist?
Restricting CORS and adding rate limits, because both are open by default and both are exploitable without any other mistake. After that, HSTS and a server-side session driver.
How is this different from the Laravel PHP production checklist?
There is no Telescope, Horizon or web-server document root to lock down, and APP_ENV defaults to production. In exchange you write API token authentication and rate limiting yourself, and you review the Rust-specific escape hatches such as AssertSqlSafe and the safe template filter.
Does this checklist apply to Laravel Go?
Most of the environment, CORS, header, session and deployment items apply to Laravel Go with different syntax. The compile-time items do not: in Go, form authorisation is optional and password hashes are hidden by a json:"-" struct tag, so those need extra review.
Related Guides
Related Fix Guides
How to Fix Missing Security Headers in Laravel
Your Laravel app is missing critical security headers like CSP, HSTS, and X-Frame-Options. Learn how to add them with middleware.
How to Fix an Exposed Laravel Telescope Dashboard
Your Laravel Telescope dashboard is publicly accessible in production, exposing requests, queries, and application data. Secure it now.
How to Fix Exposed Laravel Ignition Error Pages
Laravel Ignition error pages are visible in production, leaking stack traces and environment details. Learn how to disable them.
Other Checklists
Laravel Production Deployment Security Checklist
A comprehensive security checklist for deploying Laravel applications to production. Covers environment config, server hardening, access control, and monitoring.
Laravel API Security Checklist
Secure your Laravel API endpoints against common vulnerabilities. Covers authentication, input validation, rate limiting, and response security.
Laravel Authentication Security Checklist
Harden your Laravel authentication system against brute-force attacks, session hijacking, and credential theft with this security checklist.
Download This Checklist as PDF
Get this checklist delivered to your inbox for easy reference.
Automate These Checks with StackShield
Stop running through checklists manually. StackShield continuously monitors your Laravel application for the security issues that matter most.
Start Free Trial