Download the PHP package cboxdk/laravel-ssrf without Composer

On this page you can find all versions of the php package cboxdk/laravel-ssrf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ssrf

Cbox SSRF

A hardened, config-driven guard against server-side request forgery (SSRF) for outbound URLs in Laravel. It validates any URL your application is about to fetch — a webhook endpoint, an avatar/import URL, an OAuth callback — and refuses anything that points at a private, reserved, or cloud-metadata address.

Why

An attacker who controls a URL your server fetches can reach your internal network: http://169.254.169.254/latest/meta-data/ (cloud credentials), http://127.0.0.1:6379/ (Redis), http://10.0.0.5/admin. A correct SSRF guard is deceptively hard — most home-grown checks miss DNS rebinding, redirect hops, or IPv6 transition forms. This package handles them, and is honest about the one thing application code cannot fully solve (see Scope).

What it defends against

Install

The service provider auto-registers. Publish the config to tune the policy:

Usage

Guard an outbound request

The URL is validated and pinned at send time, so the URL that is checked is by construction the URL that is fetched. Every request this client makes is guarded, so one client can serve a loop:

Passing the URL up front still works and additionally fails fast, before a request object exists — useful when you want the rejection where the URL is chosen rather than where it is sent:

Validate user-supplied URLs (form input)

Check or assert directly

Per-sink scheme & credential rules

One guard (with one shared block-list policy) can serve several outbound sinks with different rules. Pass a scheme allow-list and/or permit embedded credentials for that call only — the IP/host enforcement is never relaxed:

allowed_schemes and allow_credentials in config/ssrf.php set the defaults; a per-call override wins for that call and inherits every other setting.

Browser-redirect targets (OAuth authorize URLs)

A URL you hand to the user's browser as a redirect — rather than fetch yourself — is validated without a DNS lookup (the browser resolves it), while still blocking IP-literal and blocked-host targets:

Configuration

config/ssrf.php exposes the full policy: allowed_schemes, allow_credentials, blocked_hosts, blocked_host_suffixes, blocked_ips, blocked_cidrs, pin_dns, and a master enforce switch. A single-tenant/on-prem install that must reach internal hosts can set SSRF_ENFORCE=false (scheme, credential, and blocked-host checks still run).

Honest scope

An application-layer guard is defense in depth, not a complete fix:

Testing

Bind the FakeResolver to make DNS deterministic in your own tests:

Documentation

Full docs in installation, architecture, testing.

License

MIT © Cbox. See LICENSE. Security policy: SECURITY.md.


All versions of laravel-ssrf with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
guzzlehttp/guzzle Version ^7.8.2 || ^8.0
guzzlehttp/promises Version ^2.0 || ^3.0
illuminate/contracts Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
psr/http-message Version ^1.1 || ^2.0
symfony/http-foundation Version ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cboxdk/laravel-ssrf contains the following files

Loading the files please wait ...