Laravel v13.45.0 came out on 1 December 2026, alongside v12.75.0. The release notes read like a long list of small fixes. A handful of them change validation and request-handling behaviour in ways that affect security. If your app accepts uploads, sits behind a proxy or load balancer, or relies on not_in to block privileged values, test these changes before you deploy.

This guide goes through the changes that matter most, shows the code patterns that behave differently now, and ends with an upgrade checklist.

Upgrade first

composer update laravel/framework --with-all-dependencies
php artisan --version   # Laravel Framework 13.45.0
php artisan test

On Laravel 12, the equivalent fixes that were backported ship in v12.75.0. Check each pull request’s branch label ([12.x] or [13.x]) in the release notes to see where a fix landed.

1. SVG uploads no longer pass dimensions by default

Before this release, the dimensions rule returned true for any SVG before it checked anything else. A rule like this:

$request->validate([
    'avatar' => ['required', 'dimensions:max_width=1000'],
]);

…accepted any SVG, including one containing JavaScript. PR #62716 explains the risk: if that file is then served inline from your own domain (for example from the public disk), you have a stored XSS problem.

From 13.45, an SVG only passes dimensions when the same attribute explicitly allows SVG through another rule:

use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\File;

// Option A: string rules
'logo' => ['required', 'image:allow_svg', 'dimensions:max_width=1000'],

// Option B: mimes including svg
'logo' => ['required', 'mimes:png,jpg,svg', 'dimensions:max_width=1000'],

// Option C: fluent File rule
'logo' => [
    'required',
    File::image(allowSvg: true),
    Rule::dimensions()->maxWidth(1000),
],

mimetypes with image/svg+xml (or image/svg) also counts as an opt-in. Raster images are validated exactly as before. Allowed SVGs still skip the pixel checks, because SVGs have no pixel dimensions.

What breaks: forms that accepted SVGs using only dimensions, or dimensions plus image or mimetypes:image/*, will now reject them. If you meant to accept SVGs, opt in explicitly. If you didn’t, you just closed a hole. Either way, sanitise or serve user SVGs with Content-Disposition: attachment rather than inline.

2. Wildcard trustProxies stops trusting everyone

An earlier 13.x change made trustProxies(at: '*') (and '**') trust 0.0.0.0/0 and ::/0. PR #62702 reverts it. With that change, every address in X-Forwarded-For was treated as a proxy, so the client-supplied left-most entry became $request->ip(). The PR notes that this allowed IP spoofing for apps using the wildcard, including the Laravel Cloud, Forge and Vapor defaults.

In 13.45, the wildcard again trusts only the proxy that is actually calling your app (REMOTE_ADDR), as it did in v13.19.0.

// bootstrap/app.php
->withMiddleware(function (Middleware $middleware) {
    $middleware->trustProxies(at: '*');
})

If you use IP addresses for rate limiting, audit logs, geo rules or allowlists, upgrade. Then check that $request->ip() shows the real client address behind your load balancer. If you have several proxy hops, list their IP ranges explicitly rather than relying on the wildcard.

3. not_in now catches numerically equal values

not_in used to be implemented as “not in“. Once in became strict, not_in started letting through values that weren’t byte-identical to a listed value but that your app later treats as equal. PR #62703 gives this example:

'role_id' => 'integer|not_in:1',

Before the fix, "+1" passed. An int cast or an integer column then stored it as 1. That’s exactly the value you tried to block. "01", "1.0" and "1e0" slipped through in similar ways.

Now a value fails when it equals a listed value either as a string or numerically (when both sides are numeric strings). Arrays are also checked element by element:

Rule Value Before After
integer|not_in:1 "+1" passes fails
numeric|not_in:1 "01", "1.0" passes fails
array|not_in:admin ["user", "admin"] passes fails

One behaviour change to note: an empty array now passes array|not_in:.... Add required or min:1 if empty input should fail. The in rule is unchanged and stays strict.

4. doesnt_contain handles typed JSON values

Rule parameters are always strings, but JSON request bodies keep their types. With strict comparison, array|doesnt_contain:1 let [1], [1.0] and [true] through. PR #62704 casts each element to a string before comparing, so those values now fail. ["0e123"] still passes doesnt_contain:0.

5. Safer same-origin redirects

Browsers follow the WHATWG URL Standard and treat a backslash as a forward slash in http(s) URLs. Laravel’s Uri class followed RFC 3986, so the two could disagree about the host. For https://evil.com\@app.test, Uri::of()->host() returned app.test, while a browser goes to evil.com. RedirectResponse::enforceSameOrigin() relied on that host, so it could allow an open redirect.

PR #62718 normalises those backslashes the way browsers do. Redirect targets that contain backslashes, control characters or whitespace now go to the fallback URL instead. Unparseable targets also fall back rather than throwing an exception.

return redirect()
    ->to($request->input('next', '/dashboard'))
    ->enforceSameOrigin('/dashboard');

If you build “return to” links from user input, this release makes that pattern noticeably safer.

Other changes worth knowing

  • Encrypter MAC checks across rotated keys (#62628, 12.x backport): when you have previous_keys, decryption now checks the MAC against every key. Previously the amount of work depended on where the matching key sat in the rotation list.
  • trustHosts(subdomains: false) is now respected when no hosts are given (#62677). Before, it still trusted every subdomain of app.url.
  • Request::isJson() is now case-insensitive, so Application/JSON bodies are read correctly (#62701).
  • Developer conveniences: MigrationEnded events now include a duration, JobAttempted reports peak memory usage, database cache writes and deletes are batched, and route:list aligns output by display width.

Write regression tests for the risky bits

A few Pest tests turn these fixes into guarantees:

use Illuminate\Http\UploadedFile;

it('rejects SVG avatars validated only by dimensions', function () {
    $svg = UploadedFile::fake()->createWithContent(
        'avatar.svg',
        '<svg xmlns="http://www.w3.org/2000/svg"><script>alert(1)</script></svg>'
    );

    $this->post('/profile/avatar', ['avatar' => $svg])
        ->assertSessionHasErrors('avatar');
});

it('blocks numerically equal role ids', function () {
    $this->post('/users', ['role_id' => '+1'])
        ->assertSessionHasErrors('role_id');
});

Adjust the routes and field names to match your app. The point is to lock in the new behaviour so a future refactor can’t quietly undo it.

Upgrade checklist

  1. Update to 13.45.0 (or 12.75.0) and run your test suite.
  2. Search for dimensions rules and decide explicitly whether SVG is allowed.
  3. If you use trustProxies(at: '*'), confirm $request->ip() behind your load balancer.
  4. Review not_in rules on arrays and add required or min:1 where empty input must fail.
  5. Check any redirect that uses user input and prefer enforceSameOrigin().

Takeaway

Laravel 13.45 isn’t a feature release, but it’s an important one. It closes an SVG upload XSS path, reverts an IP-spoofing regression, and makes not_in, doesnt_contain and same-origin redirects behave the way most developers already assumed. Upgrade soon, and spend ten minutes on the checklist above.