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

Technical Evaluation

Scope note: This is a first-pass assessment written against v1.1.0. The only release artifact available is a compare link between v1.0.1 and v1.1.0 with no published changelog body, so the delta between versions is unverified. Findings below are based on the package's stated purpose (laravel-ssrf-guard) and standard Laravel package conventions; API surface details must be confirmed against the README before commitment.

  • Architecture fit: The package addresses a narrow, well-understood control — blocking server-side requests to private, loopback, link-local, and cloud-metadata address ranges, plus associated URL parsing edge cases. This is a cross-cutting concern that belongs in a shared library rather than duplicated per service, so the package's shape is appropriate. It is an additive security control, not an architectural commitment; it does not constrain application structure.
  • Integration feasibility: Expected integration points are a validation rule (for user-supplied URLs), a facade/helper for imperative checks, and — critically — a hook into Laravel's Http client or Guzzle handler stack. The HTTP-client path is what actually prevents SSRF; the validator alone only protects inputs that happen to be validated. Feasibility is high if the HTTP-client integration exists; that is the single most important thing to verify.
  • Technical risk: The dominant risk is the classic validate-then-request (TOCTOU) gap. A check that resolves DNS, approves the URL, and then lets the request resolve DNS again is bypassable via DNS rebinding. Secondary risks: redirect chains that re-resolve to internal addresses after the initial check, IPv6 and IPv4-mapped-IPv6 literals, non-canonical IP encodings (decimal/octal/hex), and IDN/Unicode hostname normalization. A "guard" package that only covers the naive cases creates false assurance, which is worse than no control.
  • Version delta risk (v1.1.0): Minor-version bump implies additive, non-breaking change under semver. No deprecations or breaking changes are advertised. However, an empty changelog on a security-adjacent package is itself a finding — we cannot tell whether 1.1.0 tightens bypass handling, loosens allow-lists, or changes default configuration.
  • Key questions for the maintainer/owner:
    1. Does v1.1.0 include changes to address parsing, IP range classification, or redirect handling? Please publish a changelog body.
    2. Does the package intercept the actual outbound connection (pinned-IP / custom handler), or only pre-validate? If pre-validate only, is the DNS-rebinding window documented?
    3. Are redirects re-validated hop-by-hop, and is there a max-redirect cap?
    4. Which CIDR/RFC ranges are blocked by default, and is the list config-driven and test-covered?
    5. Is there a documented bypass/allow-list mechanism for legitimate internal calls (e.g., internal service mesh), and does it fail closed?

Integration Approach

  • Stack fit: Compatible with any Laravel application on a currently supported major version; requires PHP and Guzzle/Illuminate\Http\Client versions per composer.json. Should be treated as a security dependency, not a utility — it belongs in require, pinned, and covered by our dependency-review gate.
  • Migration path: Greenfield adoption is low-friction: install, publish config, register the validation rule where user-controlled URLs are accepted. For brownfield services, do not enable a global outbound block in one step — inventory all outbound HTTP call sites first, because internal service-to-service traffic will be caught by private-range blocking. Expect a non-trivial allow-list design exercise.
  • Compatibility: Two axes to check before rollout: (a) framework version support in composer.json, and (b) coexistence with any existing Guzzle middleware, retry policy, or custom handler stack already registered. Middleware ordering is the usual failure point — the guard must run on the resolved, final request.
  • Sequencing:
    1. Spike (1–2 days): Stand up the package in a scratch app; enumerate its actual public API; run a bypass test suite (localhost, 127.0.0.1, 0.0.0.0, [::1], 169.254.169.254, decimal-encoded IPs, redirect-to-internal, DNS-rebinding harness). This determines whether it is a control or a checkbox.
    2. Classify call sites: internal-by-design vs. user-supplied destination.
    3. Pilot one service with user-supplied URL fetching — the highest-value, lowest-blast-radius target.
    4. Expand, with the guard enabled by default and explicit, reviewed allow-list entries.
    5. Add a regression test in our suite that asserts the bypass cases stay blocked across upgrades — this is the durable protection against a future silent regression.

Operational Impact

  • Maintenance: Small, single-maintainer package. Low code volume but high consequence if abandoned — a stale blocklist or an unpatched bypass is a live vulnerability, not a cosmetic debt. Maintainer activity and release cadence should be reviewed at each dependency cycle.
  • Support: Community/OSS support only; no vendor SLA. Internal ownership must be assigned explicitly — a named team responsible for upgrades, allow-list review, and responding to advisories. Unowned security dependencies silently rot.
  • Scaling: Runtime cost is negligible relative to the outbound request itself, though DNS resolution on the validation path may add latency; cacheable where safe, but note that DNS caching interacts with rebinding defense (caching a previously-good resolution is exactly the attack). Configuration should be cache-compatible (config:cache).
  • Failure modes to plan for:
    • False negative (bypass): internal resource reached. Highest severity; mitigated by the regression test suite above and by egress firewalls as defense-in-depth — this package must not be the only layer.
    • False positive: legitimate internal or allow-listed endpoint blocked, causing an outage. Typically surfaces immediately after a deploy; needs a fast, non-code-change allow-list path in config.
    • Silent config drift: published config file diverging from package defaults across upgrades, leaving protections off.
    • Upgrade opacity: v1.1.0's empty changelog is the template for this failure — an upgrade that changes behavior with no readable diff summary.
  • Ramp-up: Near-zero for a developer enabling the validation rule. Meaningfully higher for the person who owns the allow-list and the egress model — budget a half-day of security review and a documented policy for exception requests. Recommend pairing with a short internal ADR stating scope (what it does not protect against) so the control is not over-trusted.

Recommendation: Proceed to a time-boxed technical spike at v1.1.0; hold the adoption decision until (a) a real changelog for 1.1.0 is available and (b) the bypass test suite confirms the package intercepts the connection rather than only pre-validating. Treat egress filtering as the primary control and this package as a complementary, developer-facing guardrail.

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