# GHSA-7fjp-g4m7-fx23: User (Encrypted) Password Field Being Serialised

> Attackers can retrieve encrypted user passwords by requesting the User model in JSON or array format due to missing serialization exclusions.

- **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:** 13 Apr 2021

## What is GHSA-7fjp-g4m7-fx23?

GHSA-7fjp-g4m7-fx23 is a vulnerability in pwweb/laravel-core, published on 13 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
Leaking Password field during serialisation of the User model. Password is in the encrypted form but if User model is requested in json or array form the value is printed.

### Patches
Issue has been patched in version 0.3.7-beta and onwards.

### Workarounds
Add the 'password' field to the Users model file in the hidden array:

```php

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'remember_token',
        'password',
    ];
```

### For more information
If you have any questions or comments about this advisory:
* Open an issue in [pwweb/laravel-core](https://github.com/pwweb/laravel-core)
* Email us at [security@pw-websolutions.com](mailto:security@pw-websolutions.com)

## Which versions are affected by GHSA-7fjp-g4m7-fx23?

2 open source packages ship an affected version, including pwweb/laravel-core.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `pwweb/laravel-core` | Packagist | All versions | 0.3.7-beta |
| `pwweb/laravel-core` | Packagist | All versions | 0.3.7-beta |

## How do I fix GHSA-7fjp-g4m7-fx23?

Upgrade pwweb/laravel-core to 0.3.7-beta or later.

## Is GHSA-7fjp-g4m7-fx23 being exploited?

There is no known exploitation of GHSA-7fjp-g4m7-fx23 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-7fjp-g4m7-fx23 and fix it if it is affected.

What it is: GHSA-7fjp-g4m7-fx23 is a vulnerability in pwweb/laravel-core, published on 13 Apr 2021. 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-7fjp-g4m7-fx23 in the wild and no public exploit code.

Affected packages and fixed versions:
- pwweb/laravel-core (Packagist): affected all versions; fixed in 0.3.7-beta
- pwweb/laravel-core (Packagist): affected all versions; fixed in 0.3.7-beta

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-7fjp-g4m7-fx23/ (Markdown: https://insights.sbomify.com/GHSA-7fjp-g4m7-fx23/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-7fjp-g4m7-fx23

---
From sbomify Insights: https://insights.sbomify.com/GHSA-7fjp-g4m7-fx23/
Summaries are generated and may contain mistakes; the official description above is the record.
