NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Flowise

GHSA-59fh-9f3p-7m39: Flowise: Mass Assignment in PUT /api/v1/user Allows Authenticated Users to Override Password Hash and Bypass Password Change Verification

mediumCVSS 4.0 6.0

Flowise 3.1.1 and earlier let any logged-in user overwrite their own password hash through PUT /api/v1/user, because the endpoint merges the whole request body into the user record. The old-password check, hashing and policy checks are skipped. A stolen session can become permanent account access. Upgrade the flowise npm package to 3.1.2.

Published May 20, 2026 · Analysis Oct 27, 2026

What an attacker can do

The controller checks that the id in the body matches the logged-in user, which blocks edits to other accounts. It then passes req.body unfiltered to userService.updateUser. That method calls queryRunner.manager.merge(User, oldUserData, newUserData), so every field on the User entity can be set: credential, tempToken, tokenExpiry, status and email.

The proper password flow needs oldPassword, newPassword and confirmPassword and checks the old password with compareHash. Sending a ready-made bcrypt hash in a credential field skips all of it, including the policy check and the session invalidation that normally follows a password change.

The attacker needs a valid JWT for the account, for example from token theft, XSS or a shared device. With it, they set a hash for a password they know and log in afterwards at will, even after the original session is revoked. The advisory scores it medium (CVSS 4.0 of 6.0): it is a persistence step after a compromise, not a way into other accounts. The writable tempToken, tokenExpiry and status fields are also exposed by the same missing allowlist, though the advisory demonstrates only the credential overwrite.

Who is affected

The npm package flowise at version 3.1.1 or earlier is affected. Check the installed version:

npm ls flowise

For Docker, check the image tag you run. Any instance with user accounts and login enabled exposes PUT /api/v1/user to authenticated users.

flowise

Ecosystem
npm
Affected
<= 3.1.1
Fixed in
3.1.2
Check
npm ls flowise

How to fix it

Upgrade flowise to 3.1.2, the patched version in the advisory.

npm install -g [email protected]

For Docker, pull an image built from 3.1.2 or later. The advisory lists no workaround. If you suspect a stolen session, reset the affected users' passwords through the supported flow, revoke their sessions, and rotate any API keys and credentials stored in the instance.

How to tell if you were hit

Look in reverse-proxy or access logs for PUT /api/v1/user requests, then inspect the bodies if you log them. A body containing a credential, tempToken, tokenExpiry or status field is abnormal. The normal change flow sends oldPassword, newPassword and confirmPassword.

In the database, check whether a user's credential value changed without a matching password-change event, and look for logins from new IP addresses shortly after such an update.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

A Mass Assignment vulnerability in the PUT /api/v1/user endpoint allows authenticated users to directly modify restricted user fields, including the credential (password hash), bypassing the intended password change workflow.

Because the endpoint forwards the entire request body to the service layer without filtering, an attacker can override the credential field without providing the current password.

This bypasses several security protections including:

  • old password verification
  • password hashing enforcement
  • password policy validation
  • session invalidation on password change

While the vulnerability cannot be used to modify other users due to an ID check in the controller, it allows attackers who obtain a temporary session (e.g., via token theft or XSS) to establish persistent account access.

Details

The endpoint PUT /api/v1/user allows authenticated users to update their user profile.

The controller checks that the authenticated user matches the provided id, preventing direct IDOR:

const currentUser = req.user
const { id } = req.body

if (currentUser.id !== id) {
    throw new InternalFlowiseError(StatusCodes.FORBIDDEN)
}

However, the controller forwards the entire request body directly to the service layer without filtering:

const user = await userService.updateUser(req.body)

Inside UserService.updateUser, the incoming data is merged into the existing user entity:

updatedUser = queryRunner.manager.merge(User, oldUserData, newUserData)

Because newUserData is derived from req.body and there is no field allowlist, any field present in the User entity may be modified.

This includes sensitive fields such as:

  • credential
  • tempToken
  • tokenExpiry
  • status
  • email

The service implements a secure password change workflow that requires the following fields:

oldPassword
newPassword
confirmPassword

Example code:

if (newUserData.oldPassword && newUserData.newPassword && newUserData.confirmPassword) {
    if (!compareHash(newUserData.oldPassword, oldUserData.credential)) {
        throw new InternalFlowiseError(StatusCodes.BAD_REQUEST)
    }

    newUserData.credential = this.encryptUserCredential(newUserData.newPassword)
}

However, this logic can be bypassed by directly supplying a credential value in the request body.

Because the merge operation applies all fields from newUserData, the supplied credential hash will overwrite the stored password hash.

PoC

Step 1 - Authenticate

Login as any normal user and obtain a valid JWT token.

POST /api/v1/auth/login

Step 2 - Generate a password hash

Generate a bcrypt hash for a password you control.

Example:

bcrypt("attacker_password")

Example hash:

$2b$10$abc123examplehashvalue...

Step 3 - Send crafted update request

PUT /api/v1/user
Authorization: Bearer <JWT_TOKEN>
Content-Type: application/json

{
  "id": "<your-user-id>",
  "credential": "$2b$10$abc123examplehashvalue..."
}

Step 4 - Login with attacker password

The password hash in the database is replaced by the supplied value.

The attacker can now authenticate using:

attacker_password

without ever providing the previous password.

Impact

This vulnerability allows authenticated users to bypass the password change security controls.

Security protections that are bypassed include:

current password verification

password hashing enforcement

password policy validation

session invalidation on password change

Although the controller prevents modification of other users' accounts, the vulnerability enables persistence after account compromise.

Example attack scenario:

  • An attacker temporarily obtains a user's session (XSS, token leak, shared device, etc.)
  • The attacker sends the crafted update request with a new password hash
  • The attacker now permanently controls the account
  • Authentication logic bypass
  • Privilege persistence after compromise
  • Weak account recovery guarantees

Credited to berkdedekarginoglu.

Questions

Can this flaw change another user's password?

No. The controller rejects requests where the body id differs from the authenticated user's id with a 403. The flaw only lets a user overwrite their own restricted fields, such as the password hash.

Which Flowise version fixes GHSA-59fh-9f3p-7m39?

Version 3.1.2 of the flowise npm package. Versions up to and including 3.1.1 are affected, and the advisory names no workaround.

What does an attacker need?

A valid login or JWT for the target account. The attack is realistic after token theft or XSS, where it turns brief access into lasting access by setting a known password hash.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Flowise vulnerabilities

All Flowise entries