79% vs 51%: independent neobanks lag on app security. Read the report

Deep Dive

Deep Dive

BISHENG Hard-Coded JWT Secret Auth Bypass (CVE-2026-130840)

A hard-coded JWT secret in BISHENG lets anyone forge an administrator cookie; fixed in 3.0.0.

TL;DR

  • BISHENG shipped a hard-coded jwt_secret and used it to sign and verify login cookies, so anyone could forge an administrator session. The flaw is CVE-2026-130840.
  • The token is an HS256 JWT in the access_token_cookie; a forged user_id of 1 reaches the built-in administrator and grants control of users, workspaces, knowledge bases and workflows.
  • The CVE is CVSS v4.0 9.3 Critical and CVSS v3.1 9.8. No exploitation is known, and it is not in CISA KEV as of 2026-11-18.
  • Upgrade to BISHENG 3.0.0 or later. The fix removes the default, generates a random secret on first start and stores it in the config table.

Am I affected?

You are affected when all of these hold:

  • You run BISHENG before 3.0.0, including the 2.x line and 3.0.0-beta1.
  • The BISHENG web UI is reachable from a network an attacker can use.
  • The deployment never set a private jwt_secret in config.yaml. A default deployment uses the hard-coded value from the public source tree.

BISHENG is an open-source enterprise agent platform for building and running AI applications. The login cookie is the only thing between an unauthenticated visitor and the administration console when the secret is the public default.

Branch Affected versions Fixed version
BISHENG 3.0 pre-release 3.0.0-beta1 3.0.0-beta2 or 3.0.0
BISHENG 2.x 2.0.0 to 2.6.0-fix2 3.0.0

Check the running version and whether a secret is configured. The first command reads the installed package; the second reads the deployment configuration.

docker exec <container> pip show bisheng | grep -E '^(Name|Version)'
grep -n 'jwt_secret' /path/to/bisheng/config/config.yaml

A fixed deployment stores an automatically generated secret in the config table. A private value in config.yaml takes precedence, so a missing row alone does not establish that the public default is in use.

SELECT `key`, `value` FROM config WHERE `key` = 'jwt_secret';

How do I fix it?

Upgrade to BISHENG 3.0.0 or later. The upgrade removes the hard-coded default, so the server generates a secret that is unique to the deployment.

  1. Upgrade to 3.0.0, or to 3.0.0-beta2 if you are testing the 3.0 pre-release line.
  2. Restart the API server and the worker. If your deployment runs a separate Linsight worker, restart that service too; every backend process must share the same secret.
  3. If no private secret is configured, confirm the config table has a jwt_secret row with a generated value.
  4. Expect every user to sign in again. Cookies signed with the old default stop working.
  5. If you set a private jwt_secret in config.yaml, keep it. The fix uses it unless it is one of the two values that shipped in the source.

To rotate the secret on a fixed deployment, change the jwt_secret value in config.yaml or delete the config row. Then restart all backend processes.

# Restart the backend and worker containers after the upgrade
docker compose restart backend backend_worker

A deployment that cannot upgrade should block the web UI from untrusted networks and set a private jwt_secret in config.yaml. The setting overrides the default, but it does not remove the default from the code.

What is the root cause?

Settings.jwt_secret carried a usable default value in the public source tree, and AuthJwt used it to sign and verify every login cookie. A deployment that never overrode it signed cookies with a key anyone could read.

The default is in src/backend/bisheng/core/config/settings.py at line 751 of the v2.6.0-fix2 tag:

jwt_secret: str = "secret_cF2kD4lW9wY4zL7eX1zX9vS1fA7eW4lQ"

The fix's design notes name two historical defaults: secret, used in 2.4, and secret_cF2kD4lW9wY4zL7eX1zX9vS1fA7eW4lQ, used from 2.6.

AuthJwt reads that value and configures the cookie and the signing algorithm in src/backend/bisheng/user/domain/services/auth.py:

self.jwt_secret = settings.jwt_secret
self.cookie_conf = settings.cookie_conf
self._access_cookie_key = "access_token_cookie"
self._encode_algorithm = "HS256"
self._decode_algorithms = [self._encode_algorithm]

The token payload carries the user identity in the sub claim. decode_jwt_token verifies the signature and the issuer, then loads the JSON from sub:

payload = jwt.decode(
    token, self.jwt_secret, issuer=self.cookie_conf.jwt_iss, algorithms=self._decode_algorithms
)
return json.loads(payload.get("sub"))

The loaded user_id selects the account. The first account, user_id 1, is the built-in administrator. An attacker who knows the secret can sign a sub naming that account and the server accepts it as a valid login. The issuer check does not help: jwt_iss comes from the same configuration and is not secret. The only thing that distinguishes a forged token is that no login request created it.

How is it exploited?

The attack needs no account and no interaction with the login form. The secret is in the public repository, so the forgery happens offline.

  1. Read the default jwt_secret from the affected BISHENG source, or from the deployment's own settings.py.
  2. Build an HS256 JWT whose sub claim names user_id 1 and the issuer the deployment expects.
  3. Send the token as the access_token_cookie cookie to the BISHENG web UI or API.
  4. The server verifies the signature with the same public secret and loads the administrator account.
  5. The attacker now acts as the administrator, with access to users, workspaces, knowledge bases and workflows.

The CVE record describes this exact path. It publishes no exploit code, and the forgery only needs a standard JWT library and the public secret.

How does the attack flow?

A public signing key lets an attacker mint an administrator cookie offline, and the server accepts it because it verifies with the same key.

flowchart LR A["Public jwt_secret
in the source tree"] --> B["Forge HS256 token
with user_id 1"] B --> C["Send as
access_token_cookie"] C --> D["AuthJwt verifies
with the same secret"] D --> E["Loads user_id 1
the built-in admin"] E --> F["Full administrative
access"]

What can an attacker do?

An attacker who forges the cookie acts as the built-in administrator of the BISHENG deployment.

  • The administrator can create, modify and delete users, and can change their roles.
  • The administrator can read and change workspaces, knowledge bases and workflows.
  • The attacker needs network access to the web UI or API. No account, password or user interaction is required.
  • The CVE does not state that the forged cookie survives a restart. Treat a forged session as an active compromise until the secret is rotated.

The CVE record lists users, workspaces, knowledge bases and workflows as the assets the attacker reaches. It does not claim code execution on the host.

Why does the fix work?

The fix removes the usable default and gives each deployment its own secret. A forged token signed with the old public value no longer verifies.

The change in settings.py is:

-    jwt_secret: str = "secret_cF2kD4lW9wY4zL7eX1zX9vS1fA7eW4lQ"
+    jwt_secret: str = ""

A new resolver in bisheng/user/domain/services/jwt_secret.py reads the config.yaml value first. If the value is empty or one of the two leaked historical defaults, the resolver generates secrets.token_urlsafe(48) once. It stores that value in the config table under the jwt_secret key, so every API and worker process reads the same row.

AuthJwt now calls resolve_jwt_secret() instead of reading settings.jwt_secret directly. The fix is complete for the login-cookie path. Personal access tokens and open API credentials use a different store, so they are not affected by the change. The resolver also treats the two historical defaults as unset, so a deployment that copied the old value into config.yaml still moves to a generated secret.

How do I check if I was compromised?

Look for administrator sessions and accounts you cannot explain. The public default makes a forged cookie indistinguishable from a real login at the token level, so the audit trail matters.

  • Check config.yaml and the config table together. A private configured secret takes precedence and needs no database row. Without one, confirm the fixed backend creates a jwt_secret row on first use; older code falls back to the public default.
  • Review administrator accounts and role changes for entries you cannot attribute.
  • Review access logs for requests carrying access_token_cookie without a matching login request.
  • Check workspaces, knowledge bases and workflows for changes made outside your change windows.
  • Review model credentials and platform settings for modifications.
  • If you find an unexplained administrator action, rotate the secret and force every user to sign in again.

No public indicators of compromise exist for this CVE. An attempt leaves a valid-looking token, not a malformed request. A forged token is valid on its face, so only the audit trail separates it from a real login.

Timeline

The fix was written in September and shipped in the 3.0.0 line; the CVE was published after the release.

The fix commit is from September 14, the 3.0.0 release from November 4, and the CVE from November 17
Figure 1: The fix, the 3.0.0 release and the CVE publication. Source: BISHENG commit and release pages (checked November 18, 2026).

  • 2026-09-14: The fix commit removes the default secret and adds the generated-secret resolver.
  • 2026-11-04: BISHENG 3.0.0 is released with the fix.
  • 2026-11-17: The CVE record for CVE-2026-130840 is published.
  • 2026-11-18: No exploitation is known, and the CVE is not in CISA KEV.

FAQ

Is the bypass unauthenticated?

Yes. The attacker needs no account and no password. The only requirement is network access to the web UI or API and the public default secret in the deployment.

Which versions are affected?

Every release before 3.0.0, including the 2.x line and 3.0.0-beta1. The fix first shipped in 3.0.0-beta2 and is in 3.0.0 and later.

Do I have to rotate the secret after upgrading?

No manual rotation is needed for a default deployment. The fixed release generates a random secret on first start, and every existing cookie becomes invalid. If you had a private secret, the fix keeps using it.

Is there a public proof of concept?

The CVE record describes the forgery path, but no exploit code is linked. The attack only needs a JWT library and the public default secret.

Is it exploited in the wild?

No exploitation is known as of 2026-11-18, and the CVE is not in CISA KEV. A deployment that used the default should still treat the upgrade as urgent, because the secret is public.

Do personal access tokens use the same secret?

No. The fix notes that personal access tokens and open API credentials are checked against the database, not signed with this key. Rotating the login secret does not invalidate them.

Scan BISHENG deployments with Ostorlab

Ostorlab's Web Agentic Deep Scan exercises self-hosted web applications and APIs the way an attacker would. It can find exposed BISHENG consoles and check their authentication before an attacker does. Start at https://www.ostorlab.co/product/web_agentic_deep_scan

References

  • CVE Program, "CVE-2026-130840", 2026-11-17 (checked November 18, 2026). https://www.cve.org/CVERecord?id=CVE-2026-130840
  • BISHENG, fix commit b98e2bc5, 2026-09-14 (checked November 18, 2026). https://github.com/dataelement/bisheng/commit/b98e2bc5c819a6a8d35538d91eab85833bd77703
  • BISHENG, vulnerable settings.py at v2.6.0-fix2, 2026-08-11 (checked November 18, 2026). https://github.com/dataelement/bisheng/blob/v2.6.0-fix2/src/backend/bisheng/core/config/settings.py#L751
  • BISHENG, auth.py at v2.6.0-fix2, 2026-08-11 (checked November 18, 2026). https://github.com/dataelement/bisheng/blob/v2.6.0-fix2/src/backend/bisheng/user/domain/services/auth.py#L123-L187
  • BISHENG, "v3.0.0 release", 2026-11-04 (checked November 18, 2026). https://github.com/dataelement/bisheng/releases/tag/v3.0.0
  • BISHENG repository, 2026-11-18 (checked November 18, 2026). https://github.com/dataelement/bisheng