Tools & Reviews 6 min read Markdown

Laravel Go Vulnerability Scanner: govulncheck, gosec and External Scans

Scanning a Laravel Go app takes three tools doing three jobs: govulncheck for dependencies you actually call, gosec and a few greps for the code, and an external scan for what production exposes. Here is how to set each up and what it will miss.

Matt King
Matt King
December 6, 2026
Last updated: December 6, 2026
Laravel Go Vulnerability Scanner: govulncheck, gosec and External Scans

Laravel Go entered beta on 2 December 2026. Go already has good security tooling, so you are better placed than with most new frameworks, but none of it knows anything about Laravel Go yet. This is how to assemble a scan that covers dependencies, code and the running application, and where the gaps are.

Dependencies: govulncheck

go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...

govulncheck is the Go team's own tool. Its advantage over most dependency scanners is call-graph analysis: it reports a vulnerability only if your code can reach the affected function, so results are short and actionable. It also covers the Go standard library, which matters here because Laravel Go is built directly on net/http and database/sql. A standard library advisory is fixed by upgrading your Go toolchain and rebuilding.

That last point is easy to miss. The standard library and every module are compiled into your binary, so patching the server does nothing. Every fix, in Go itself or in a module, requires a rebuild and redeploy. Record which Go version built each release.

Then the front end:

npm audit --omit=dev

On Laravel Cloud the pre-filled build runs npm ci --audit false, so this needs to happen in CI.

Code: gosec, staticcheck and four greps

go install github.com/securego/gosec/v2/cmd/gosec@latest
gosec ./...

go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...

gosec finds generic Go problems: weak randomness, hard-coded credentials, unsafe file paths, SQL built with string formatting when it goes to database/sql. It has no rules for Laravel Go's own API, so add these searches.

Raw SQL. The *Raw builder methods embed their string verbatim:

grep -rnE "(Select|Where|OrWhere|Having|OrderBy)Raw\(|db\.Raw\(|\.Pool\(\)|db\.From\(" --include=*.go .

Any hit that includes fmt.Sprintf or + deserves a close look.

Secrets without a JSON tag. Password hashes and tokens on models must carry json:"-":

grep -rnE "(Password|Token|Secret)\s+\S+" --include=*.go models/ | grep -v 'json:"-"'

Unescaped HTML.

grep -rn "template.HTML(" --include=*.go .

Middleware removed.

grep -rnE "\.Without\(|Except:|AllowCredentials|AllowedOriginPatterns" --include=*.go .

That last search surfaces CSRF exclusions and CORS settings together. Check that origin patterns are anchored with ^ and $, and that AllowCredentials never appears without an explicit origin list.

Two things no scanner catches. Form types without an Authorize method are valid Go, so missing authorisation needs tests that act as the wrong user. And goroutines without a recover will take the process down on a panic; review every go func.

The deployed app: an external scan

Static tools read code. They cannot tell you that production is missing HSTS or that the load balancer is not in the trusted proxy list. External checks that apply to Laravel Go:

  • Security headers. Only X-Frame-Options and X-Content-Type-Options are sent by default. (Header checker)
  • CORS. The default allows any origin on api/*. Test whether an arbitrary Origin is reflected, and whether credentials are allowed.
  • Session cookie flags. In Laravel Go, Secure is set when the request arrived over HTTPS, which behind a load balancer depends on trusted proxies. A cookie without Secure on an HTTPS site is the visible symptom. (Cookie checker)
  • TLS at the proxy in front of the binary. (SSL checker)
  • Debug mode. A Laravel Go debug page shows source, request headers and a stack. Force an error and confirm you get a bare "Server Error".
  • /metrics. If you mounted the Prometheus handler as the docs show, check it is not reachable from the internet.
  • Exposed files and backups under public/, and secrets in JavaScript bundles.
  • Host header handling and subdomain takeover.

What StackShield covers today

StackShield's external scanner was written for Laravel PHP. Against a Laravel Go app, the checks that do not depend on PHP run as normal: headers, TLS, cookie flags, CORS, exposed files and backups, secrets in JavaScript bundles, Host header poisoning and subdomain takeover. Telescope, Horizon, Ignition and Livewire checks have nothing to find.

StackShield also has a Laravel Rust and Go profile. It recognises the framework from the pages it builds itself, reports the debug page or debug JSON if a response contains it, flags an application running with APP_ENV=local, and looks for an exposed Go profiler at /debug/pprof/, an expvar page at /debug/vars and a Prometheus /metrics endpoint. One limit: Laravel Go only shows debug output on a server error, and we do not try to make your application fail, so a pass is not proof that APP_DEBUG is off. Start with the free scan.

A CI baseline

go vet ./...
staticcheck ./...
gosec ./...
govulncheck ./...
go test ./...
npm audit --omit=dev

Add a scheduled govulncheck run as well, so a new advisory against an unchanged build still reaches you, and scan the deployed environment after each release.

The Laravel Go security guide explains each of the settings these scans check.

Free security check

Is your Laravel app exposed right now?

34% of Laravel apps we scan have at least one critical issue, and most teams do not find out until something breaks. The free scan checks your live app in 60 seconds. Then StackShield re-runs every check after each deploy, so a fix you ship today does not quietly regress next week.

18% have debug mode on
72% missing security headers
12% have exposed .env
Scan My App Free No signup for the scan. Continuous monitoring on a 14-day trial, no card.

Frequently Asked Questions

What is the best vulnerability scanner for Laravel Go?

There is no single one. Use govulncheck for Go module vulnerabilities, gosec and staticcheck for code issues, npm audit for the front end, and an external scanner for the deployed application. No Laravel Go specific scanner existed as of December 2026, since the framework had only just entered beta.

Does govulncheck cover the Laravel Go framework itself?

It covers any module with an entry in the Go vulnerability database. No advisories had been published for the Laravel Go framework as of 6 December 2026, so a clean result reflects that, not an audit. Keep the framework on its latest 0.x tag to pick up fixes.

Can gosec detect SQL injection in Laravel Go query builder calls?

Not reliably. gosec looks for string-built SQL passed to database/sql. It does not know that WhereRaw or db.Raw embed their argument verbatim. Search for those method names directly.

Does StackShield work with Laravel Go?

The language-independent external checks work today: security headers, TLS, cookies, CORS, exposed files, secrets in JavaScript bundles, Host header handling and subdomain takeover. A Laravel Rust and Go profile recognises the framework, reports debug output or a local environment when a response shows it, and looks for an exposed Go profiler, expvar page and Prometheus metrics endpoint.

Related Security Terms

Stay Updated on Laravel Security

Get actionable security tips, vulnerability alerts, and best practices for Laravel apps.