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

Deep Dive

Deep Dive

Kerberos Agent Auth Bypass via Default JWT Key (CVE-2026-135208)

Kerberos Agent falls back to a published JWT key, so an unauthenticated attacker can forge an admin token and control cameras; 3.14.4 fixes it.

TL;DR

  • Kerberos Agent uses the published string TOBECHANGED as its JWT signing key whenever AGENT_JWT_SECRET is unset. Anyone can sign an administrator token with that key.
  • Every release through 3.14.3 is affected, and the project's own Docker Compose, Kubernetes, snap and balena manifests leave the variable unset.
  • The CVE record rates the flaw CVSS v3.1 9.8 and CVSS v4.0 9.3 Critical. No exploitation is publicly reported, and it is not in CISA KEV as of November 23, 2026.
  • Upgrade to 3.14.4 or later and set AGENT_JWT_SECRET before the agent starts. Factory-managed agents need a shared secret.

Am I affected?

You are affected if all of these conditions hold:

  • You run Kerberos Agent 3.14.3 or earlier, from the container image or from a binary or source build.
  • AGENT_JWT_SECRET is unset or set to TOBECHANGED. The project's own deployment manifests leave it unset, so a default installation keeps the published signing key.
  • The agent's HTTP server is reachable by the attacker. The server binds every interface on port 80 by default, and the published Docker examples map that port to the host.

The attacker does not need an existing account or a valid token. The token middleware accepts any decoded user object, so a forged token with an arbitrary username is enough.

Kerberos Agent is the camera-side component of the Kerberos.io video surveillance platform. It records streams and serves live view. It connects cameras over RTSP and ONVIF to Kerberos Hub or Kerberos Vault. Many installations sit on a camera VLAN, but the default port and the container examples make accidental exposure common.

The project repository has 1,134 stars on GitHub, and the kerberos/agent container image has 1,519,926 pulls on Docker Hub.

Release line Affected versions Fixed version
3.14 3.14.0 through 3.14.3 3.14.4
3.13 and earlier every release 3.14.4 or later

The current release is 3.14.6. It contains the token fix plus two follow-ups, and it is the version to install.

Check the running container, not a freshly pulled image:

docker exec <container> /home/agent/main version

The same command works for a binary or source installation when run from the agent directory:

./main version

Check whether the signing key was left at its default:

docker exec <container> printenv AGENT_JWT_SECRET

An empty result on an affected release means the agent used TOBECHANGED. On a fixed release an empty result is normal, because the agent generates and stores its own secret.

How do I fix it?

Upgrade to Kerberos Agent 3.14.4 or later and set AGENT_JWT_SECRET to a long random value before the agent starts.

  1. Pull the fixed image and recreate the container:
docker pull kerberos/agent:3.14.6
docker stop <container>
docker rm <container>
docker run -d --name kerberos-agent -p 80:80 -v /srv/kerberos-agent:/home/agent/data -e AGENT_JWT_SECRET="$(openssl rand -hex 32)" kerberos/agent:3.14.6

Keep the ports, volumes and other environment variables of your existing deployment. For a binary or source installation, install the v3.14.6 release or rebuild from that tag.

  1. Put the same AGENT_JWT_SECRET value in the environment of every agent that must accept tokens from Kerberos Factory. A per-agent random value is stronger, but a shared value is required when Factory signs the tokens.
  2. Redeploy Factory-managed agents with that explicit secret. The fix pull request says agents that Factory deployed without AGENT_JWT_SECRET need to be redeployed with one.
  3. Change AGENT_PASSWORD from its default root. The fix does not change the default password.
  4. Sign in once more after the upgrade. Changing the signing key invalidates the tokens issued before it.
  5. Rotate the camera RTSP and ONVIF credentials, the Kerberos Hub keys and the recording encryption key if the agent was reachable while unpatched.

If you cannot upgrade yet, set AGENT_JWT_SECRET to a random value on 3.14.3. That stops token forgery with the published signing key, but it does not add authentication to the live-view WebSocket or the recording file route, which the upgrade does. Keep port 80 off untrusted networks in either case.

Version 3.14.5 separately changes how recording keys are derived, using PBKDF2 and AES-GCM. Version 3.14.6 lets an agent accept Factory tokens when the shared secret is configured. Install 3.14.6 unless a packaging constraint holds you to 3.14.4.

What is the root cause?

The token middleware signs and verifies every JWT with a key that falls back to the published string TOBECHANGED when AGENT_JWT_SECRET is unset. The fallback is in the source tree, so the signing key of a default deployment is public.

The vulnerable code is in machinery/src/routers/http/jwt_middleware.go at release 3.14.3, at lines 17 to 28:

    // Allow the JWT signing secret to be configured through an environment
    // variable so that tokens issued by another service (e.g. the Kerberos
    // Factory) can be validated by the agent. Falls back to the historic
    // default to preserve backwards compatibility.
    myKey := os.Getenv("AGENT_JWT_SECRET")
    if myKey == "" {
        myKey = "TOBECHANGED"
    }

    m := jwt.GinJWTMiddleware{
        Realm:       "kerberosio",
        Key:         []byte(myKey),

The key becomes jwt.GinJWTMiddleware.Key, the HMAC secret used by the appleboy/gin-jwt middleware to verify the signature and to decode the claims. An empty environment variable therefore selects a key that every reader of the repository knows.

The authorization check at lines 99 to 104 compounds the problem. The Authorizator accepts any decoded *models.User and never compares the username or role:

        Authorizator: func(data interface{}, c *gin.Context) bool {
            if _, ok := data.(*models.User); ok { //&& v.Username == "admin" {
                return true
            }
            return false
        },

The username comparison that would have limited the token to one account sits inside the comment. A token that names any user passes.

The login handler at lines 57 to 65 also has default credentials. When the environment variables are unset, the username and password are both root:

            usernameFromConfig := os.Getenv("AGENT_USERNAME")
            if usernameFromConfig == "" {
                usernameFromConfig = "root"
            }
            passwordFromConfig := os.Getenv("AGENT_PASSWORD")
            if passwordFromConfig == "" {
                passwordFromConfig = "root"
            }

The hard-coded signing key is the stronger issue. Forging a token bypasses the login form, so the attack still works after an operator changes the root password.

Two routes outside the /api group had no token middleware at 3.14.3. /ws served the live camera stream, and /file/*filepath served recordings. The same release also registered the Go profiler on the public server. The fix commit closes those gaps as part of the same hardening.

How is it exploited?

  1. The attacker finds an agent whose HTTP port answers. The default port is 80, and no prior credential is needed.
  2. The attacker builds an HS256 JWT signed with the key TOBECHANGED. The payload stores a user object under the id claim, with a chosen username and the role admin, and sets an expiry in the future.
  3. The attacker sends the token as Authorization: Bearer <token> to /api/config, or to the legacy /config route.
  4. The middleware verifies the signature with the default key, decodes the claims, and the Authorizator accepts the decoded user.
  5. The response returns the agent configuration, including the agent key.
  6. With a camera configured, the same token reads the stored RTSP and ONVIF credentials, the Kerberos Hub keys and the recording encryption key. It also reaches the state-changing routes that rewrite the configuration, stop the camera and move it over ONVIF.

The advisory documents the forged claims and the observed responses. Its control requests show the difference the key makes:

no token               -> GET /api/config -> HTTP 401   (control)
token, wrong key       -> GET /api/config -> HTTP 401   (control, proves the key is what matters)
token, key=TOBECHANGED -> GET /api/config -> HTTP 200
    body: {"config":{"type":"","key":"B9NR5TUP0XHE9HRS5CYYOZGH10I22C","name":"agent", ... }}

The advisory does not publish a complete exploit script. It publishes the claims structure, the key and the observed output, which are enough to reproduce the bypass in a few lines of code.

How does the attack flow?

One forged token signed with a public constant passes signature verification and the permissive authorizer, and the request runs with administrative access to the agent and its camera credentials.

flowchart LR A["Attacker reaches agent on port 80"] --> B["Builds HS256 token
key TOBECHANGED"] B --> C["Sends Authorization bearer
to /api/config"] C --> D["gin-jwt verifies signature
with the published signing key"] D --> E["Authorizator accepts any user
no account check"] E --> F["Reads agent config
camera and Hub credentials"] F --> G["Rewrites config and controls camera"]

What can an attacker do?

A forged administrator token gives full control of the agent's configuration and camera integrations.

  • Read the agent configuration, including the agent key and the configured camera URLs.
  • Read the RTSP and ONVIF usernames and passwords for the connected camera.
  • Read the Kerberos Hub keys, the Vault settings and the recording encryption key.
  • Rewrite the configuration through POST /api/config and the legacy POST /config.
  • Stop the camera stream, move the camera over ONVIF pan, tilt and zoom, and switch relay outputs.
  • Watch the live stream through the unauthenticated /ws route and download recordings through /file on 3.14.3.

These actions need the conditions in "Am I affected?": an affected release, a default or known signing key, and network reach to the HTTP port. They do not need a valid account.

The advisory does not describe code execution on the agent host, and the post does not claim it. The impact is the camera feed, the stored credentials and control of the device's surveillance function.

Why does the fix work?

The fix replaces the constant fallback with a random per-install secret and rejects tokens that do not belong to the configured account.

-func JWTMiddleWare() jwt.GinJWTMiddleware {
+func JWTMiddleWare(configDirectory string) jwt.GinJWTMiddleware {

    identityKey := "id"
-   // Allow the JWT signing secret to be configured through an environment
-   // variable so that tokens issued by another service (e.g. the Kerberos
-   // Factory) can be validated by the agent. Falls back to the historic
-   // default to preserve backwards compatibility.
-   myKey := os.Getenv("AGENT_JWT_SECRET")
-   if myKey == "" {
-       myKey = "TOBECHANGED"
-   }
+   // AGENT_JWT_SECRET lets tokens issued by another service (e.g. the
+   // Kerberos Factory) be validated by the agent. Without it, a random secret
+   // is generated once and stored with the configuration; see loadJWTSecret.
+   myKey := loadJWTSecret(configDirectory)

    m := jwt.GinJWTMiddleware{
        Realm:       "kerberosio",
-       Key:         []byte(myKey),
+       Key:         myKey,

The new loadJWTSecret function reads AGENT_JWT_SECRET when it is set. Otherwise it reads a persisted secret from data/config/jwt_secret. If none exists, it generates 32 random bytes, writes them as 64 hexadecimal characters with mode 0600, and reuses them on later starts. A persisted secret shorter than 32 characters is replaced. An explicit AGENT_JWT_SECRET is used unchanged, even if it is short or set to TOBECHANGED, so replace that value before upgrading. If the file cannot be written, the agent keeps a random secret in memory and sessions do not survive a restart.

The same commit adds the account check:

        Authorizator: func(data interface{}, c *gin.Context) bool {
-           if _, ok := data.(*models.User); ok { //&& v.Username == "admin" {
-               return true
-           }
-           return false
+           // Only the configured account may use the API, even with a
+           // validly signed token.
+           user, ok := data.(*models.User)
+           return ok && user.Username != "" && user.Username == agentUsername()
        },

The fix also puts the live-view WebSocket, the recording file route and the profiler behind the token middleware. The profiler is disabled unless AGENT_ENABLE_PPROF=true.

The change is complete for the paths the advisory describes. It does not remove the default root password, so an operator who leaves AGENT_PASSWORD unset keeps a second weakness. It also does not invalidate tokens stored elsewhere; the upgrade does that by changing the key.

How do I check if I was compromised?

The advisory publishes no indicators of compromise, so look for configuration changes and unexpected use of the API.

Start with the signing-key state and the configuration file on each agent:

docker exec <container> printenv AGENT_JWT_SECRET
docker exec <container> cat /home/agent/data/config/config.json

Compare the camera URL and the Hub and Vault settings with your deployment baseline. Check the relays and the credentials too. An empty AGENT_JWT_SECRET on 3.14.3 means the published signing key was in use.

Search any reverse-proxy or access log in front of the agent for requests to the authenticated routes:

grep -E '/(api/)?config|/api/camera/stop|/api/onvif' /var/log/nginx/access.log

A forged request looks like a normal authenticated API call, so a hit is a lead rather than proof. Check the source addresses against your known management hosts. An agent with no proxy in front may keep no request log at all, and a failed attempt can leave no trace.

Check for unexpected outbound connections from the agent host to Kerberos Hub, Kerberos Vault or unknown addresses, and review whether the camera settings or recordings changed without an operator action.

If you find a sign of use, rotate the camera credentials, the Hub keys and the recording encryption key, then rebuild the agent from a clean image. Replacing the configuration file alone does not prove that no other change remains.

Timeline

  • 2026-11-21 22:12 UTC: the fix commit c0baade8 is authored, and pull request #361 merges at 22:26 UTC.
  • 2026-11-21 22:31 UTC: Kerberos Agent 3.14.4 is released with the new key handling.
  • 2026-11-21 22:36 UTC: the project publishes advisory GHSA-3c52-7fc8-c39j.
  • 2026-11-22: versions 3.14.5 and 3.14.6 follow with the recording-key and Factory-token changes.
  • 2026-11-23 15:44 UTC: CVE-2026-135208 is published with CVSS v4.0 9.3 and v3.1 9.8.

Timeline from the 3.14.4 fix and advisory to the CVE record
Figure 1: The fix, the 3.14.4 release and the advisory all landed on November 21, 2026; the CVE record followed on November 23. Source: GitHub releases, fix commit and CVE record, checked November 23, 2026

FAQ

Is there a CVE?

Yes. CVE-2026-135208 was published on November 23, 2026 with CVSS v4.0 9.3 and CVSS v3.1 9.8. The GitHub advisory GHSA-3c52-7fc8-c39j predates it and carries the technical detail.

Does changing the default root password stop the attack?

No. The forged token bypasses the login form, so a changed password does not help while the signing key remains TOBECHANGED. Set AGENT_JWT_SECRET or upgrade to 3.14.4, and change the password as a second step.

Are all deployment types affected?

Yes, when the signing key is unset. The project's Docker Compose, Kubernetes, snap and balena manifests do not set AGENT_JWT_SECRET. Every installation type uses the same middleware.

Was it exploited in the wild?

No exploitation is publicly reported. Neither the advisory nor the CVE record describes attacks, and the flaw is not in CISA KEV as of November 23, 2026.

Will the upgrade break Kerberos Factory?

It can. Agents that Factory deployed without AGENT_JWT_SECRET need to be redeployed with an explicit shared secret. Version 3.14.6 accepts Factory tokens when that secret is configured.

What else does the fix change?

It requires a token on the live-view WebSocket and on the recording file route, and it disables the Go profiler by default. Those changes close access paths that the signing-key fix alone would leave open.

References

  • GitHub advisory GHSA-3c52-7fc8-c39j: https://github.com/kerberos-io/agent/security/advisories/GHSA-3c52-7fc8-c39j (checked November 23, 2026)
  • CVE-2026-135208 record: https://www.cve.org/CVERecord?id=CVE-2026-135208 (checked November 23, 2026)
  • Fix commit c0baade8: https://github.com/kerberos-io/agent/commit/c0baade8fd6e21ed1b9a834d9ae6b4eaaa67b3b6 (checked November 23, 2026)
  • Fix pull request #361: https://github.com/kerberos-io/agent/pull/361 (checked November 23, 2026)
  • Release v3.14.4: https://github.com/kerberos-io/agent/releases/tag/v3.14.4 (checked November 23, 2026)
  • Vulnerable jwt_middleware.go at v3.14.3: https://github.com/kerberos-io/agent/blob/v3.14.3/machinery/src/routers/http/jwt_middleware.go (checked November 23, 2026)
  • Vulnerable routes.go at v3.14.3: https://github.com/kerberos-io/agent/blob/v3.14.3/machinery/src/routers/http/routes.go (checked November 23, 2026)
  • Kerberos Agent repository: https://github.com/kerberos-io/agent (checked November 23, 2026)
  • Kerberos Agent container image: https://hub.docker.com/r/kerberos/agent (checked November 23, 2026)

Free scan

Scan your own app for free

or book a demo

Keep reading

Related articles

Browse the blog