# GHSA-7852-w36x-6mf6: Laravel Encrypter Component Potential Decryption Failure Leading to Unintended Behavior

> Attackers can manipulate encrypted payloads to cause decryption failures, potentially bypassing security checks in applications using weak type comparisons.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 May 2024

## What is GHSA-7852-w36x-6mf6?

GHSA-7852-w36x-6mf6 is a vulnerability in laravel/framework, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The Laravel Encrypter component is susceptible to a vulnerability that may result in decryption failure, leading to an unexpected return of `false`. Exploiting this issue requires the attacker to manipulate the encrypted payload before decryption. When combined with weak type comparisons in the application's code, such as the example below:

```
<?php

$decyptedValue = decrypt($secret);

if ($decryptedValue == '') {
    // Code is run even though decrypted value is false...
}
```

## Which versions are affected by GHSA-7852-w36x-6mf6?

4 open source packages ship an affected version, including laravel/framework.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `laravel/framework` | Packagist | All versions | 5.5.40 |
| `laravel/framework` | Packagist | All versions | 5.5.40 |
| `laravel/framework` | Packagist | From 5.6.0 | 5.6.15 |
| `laravel/framework` | Packagist | From 5.6.0 | 5.6.15 |

## How do I fix GHSA-7852-w36x-6mf6?

Upgrade laravel/framework to a fixed version for your release line: 5.5.40 or 5.6.15.

## Is GHSA-7852-w36x-6mf6 being exploited?

There is no known exploitation of GHSA-7852-w36x-6mf6 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7852-w36x-6mf6 and fix it if it is affected.

What it is: GHSA-7852-w36x-6mf6 is a vulnerability in laravel/framework, published on 15 May 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-7852-w36x-6mf6 in the wild and no public exploit code.

Affected packages and fixed versions:
- laravel/framework (Packagist): affected all versions; fixed in 5.5.40
- laravel/framework (Packagist): affected all versions; fixed in 5.5.40
- laravel/framework (Packagist): affected from 5.6.0; fixed in 5.6.15
- laravel/framework (Packagist): affected from 5.6.0; fixed in 5.6.15

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-7852-w36x-6mf6/ (Markdown: https://insights.sbomify.com/GHSA-7852-w36x-6mf6/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7852-w36x-6mf6

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7852-w36x-6mf6/
Summaries are generated and may contain mistakes; the official description above is the record.
