Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Ssrf Guard Laravel Package

jeffersongoncalves/laravel-ssrf-guard

A Laravel package that helps protect your app from Server-Side Request Forgery (SSRF) by validating outbound URLs and blocking requests to private, loopback, and reserved network ranges. Useful for guarding HTTP clients and any user-supplied URLs.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on egress security. An SSRF guard is a small, well-scoped security control that most teams either hand-roll badly (a filter_var check on a URL) or skip entirely. Adopting a maintained package removes that decision from your backlog and replaces it with a dependency-review decision — a much cheaper one.
  • Feature work involving user-supplied URLs. Anything where a customer, tenant, or webhook sender hands you a URL that your server then fetches: webhook delivery, link unfurling/previews, image or PDF import from a URL, RSS/feed ingestion, "import from URL" flows, screenshot services, and webhook-registration verification. If a roadmap item has the phrase "…and then we fetch it," this package belongs in that design review.
  • Threat-model coverage in the security roadmap. SSRF is a recurring item in pentest findings and bug-bounty reports for exactly the class of features above. Having a named, centralized control to point at shortens the "how do we prevent this class of issue" conversation and gives you a defensible default rather than a per-team convention.
  • Compliance and audit posture. For SOC 2 / ISO 27001 evidence, a single documented, versioned control for outbound request validation is easier to attest to than scattered per-service validation logic.
  • Incident follow-up. If you have had an SSRF finding (metadata-endpoint access, internal port scanning, DNS rebinding), this is the kind of fix that closes the class rather than the instance.
  • Platform vs. product ownership. If you run a shared Laravel platform or service template, a guard like this is a candidate for the base image — one decision amortized across every service, rather than N teams rediscovering it.

When to Consider This Package

Adopt when most of the following hold:

  • You are on Laravel, and the fetches happen in-process. The value of a Laravel-native package is framework integration — middleware, config, container bindings, and a guard wired into the HTTP client or Http facade. If your outbound requests are made by a separate service (a dedicated fetcher/worker in Go, Node, or Python), a PHP package buys you very little.
  • You can actually enforce it at a choke point. The package is only as good as your ability to route all outbound fetches of user-controlled URLs through it. If your codebase has dozens of ad-hoc curl/Guzzle call sites, budget the migration work before you buy the dependency; a guard that covers 60% of call sites gives false confidence.
  • The alternative is worse. If the realistic alternative is "no protection" or "a regex someone wrote in 2021," this is a clear improvement even if the package is small and thinly maintained.
  • You can absorb a young dependency. A 1.0.x → 1.1.0 version history means a short track record. That is acceptable for a security control you can read in an afternoon, and unacceptable if you need vendor SLAs, an active security-response process, or a maintained CVE feed. Prefer it where you can vendor, pin, and add your own regression tests; avoid it as a sole control on a high-value, internet-exposed data path without that extra scrutiny.
  • You are prepared to configure an allowlist, not just a denylist. Package defaults typically block loopback and private ranges; your product probably needs to reach specific internal services or a partner's fixed IPs. Check that the policy model is expressive enough for your real topology before committing.

Look elsewhere (or budget for in-house work) when:

  • You need egress control at the network layer. DNS pinning, IP allowlisting, and metadata-endpoint blocking are strongest enforced by a proxy, service mesh policy, or firewall. A PHP-layer guard is a defense-in-depth layer, not a substitute — it runs in the same process that has the credentials.
  • You need proof, not just prevention. If your requirement is audit logging of every blocked and allowed outbound request with alerting, verify logging/observability hooks exist; a guard that silently blocks is hard to operate.
  • You cannot pin and review. For a security-relevant dependency at this maturity, you should be reading the diff on each bump. Note on this release: v1.1.0's published notes contain only a compare link with no description of new behavior. Treat the minor bump as unverified until someone reads the diff — new features in a security package can include new configuration surfaces or new bypass-relevant code paths, and "minor version, backwards compatible" tells you about semver, not about risk. Confirm before you upgrade in production.

How to Pitch It (Stakeholders)

For executives (30 seconds): We have a recurring class of security risk where our own servers can be tricked into fetching internal addresses on an attacker's behalf — this is how internal metadata services, admin panels, and databases get reached from the outside. The fix is a small, cheap, well-understood guard on outbound requests. This package gives us that guard for our Laravel services at roughly the cost of a dependency review, instead of an engineering project. It is a hygiene control, not a platform bet.

For engineering leadership: This is a narrow, auditable dependency that centralizes validation of user-supplied URLs. It does not replace network-level egress controls; it's the application-layer layer of a defense-in-depth story, and it's the layer that catches the mistakes engineers actually make. The real cost isn't the install — it's auditing our call sites and routing every user-controlled fetch through it. Ask for that migration budget explicitly, because a partially-enforced guard is worse than a known gap: it creates the appearance of coverage.

For the security team: Ask three questions before sign-off. (1) What is the policy model — denylist of private ranges, allowlist, DNS-rebinding protection, redirect-following behavior? (2) Where does it sit — does it wrap the HTTP client, or does it require discipline at each call site? (3) What does it log, and can we alert on blocks? Also ask for the v1.1.0 diff to be read and summarized; the release notes as published don't describe the change, and we should not upgrade a security control on an unexplained minor bump.

For the roadmap conversation: Frame this as unblocking URL-fetching features — link previews, webhook verification, URL imports — that are currently gated on "we need to do this safely first." The package is what converts a stalled roadmap item into a normal ticket.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo