Skip to content
Access control Disclosed report Beginner

Argocd's web terminal session doesn't expire

Argo CD web terminal sessions did not expire when the underlying web session token expired. An attacker with an already-open terminal could keep sending websocket messages and view sensitive information after they should have been logged out.

bean-zhang Follow

Originally disclosed on HackerOne

Bounty$2,540 Medium 4.7 View original
  • Triaged in 9 hours
  • Fixed in 14 days
  • Paid in 14 days
  • Disclosed after 15 days

Summary by the program

All versions of Argo CD starting from v2.6.0 have a bug where open web terminal sessions do not expire. This bug allows users to send any websocket messages even if the token has already expired. The most straightforward scenario is when a user opens the terminal view and leaves it open for an extended period. This allows the user to view sensitive information even when they should have been logged out already.

Patches A patch for this vulnerability has been released in the following Argo CD version:

v2.6.14 v2.7.12 v2.8.1

The report

The vulnerability is that web terminal sessions do not expire, even if the argocd's web session has expired.

Step 1: Log in to ArgoCD.

Step 2: Open a web terminal session in ArgoCD, which is used to operate a machine.

Step 3: Wait until the web session expires, but the web terminal session does not expire.

Impact

All versions of Argo CD starting from v2.6.0 have a bug where open web terminal sessions do not expire. This bug allows users to send any websocket messages even if the token has already expired. The most straightforward scenario is when a user opens the terminal view and leaves it open for an extended period. This allows the user to view sensitive information even when they should have been logged out already.

Attachments

argocd-web-based-terminal-JWT.mp4 From the original on HackerOne

The original report as published on HackerOne, by bean-zhang. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 3 min read.

Context

Argo CD is a continuous delivery tool for Kubernetes, and the report concerns its web-based terminal. The terminal lets a user operate a machine from the Argo CD UI over a websocket connection. The program's summary states that all versions of Argo CD starting from v2.6.0 have a bug where open web terminal sessions do not expire. The weakness is classified as insufficient session expiration, with a medium severity and a CVSS score of 4.7. The report was disclosed on 9 September 2023 under the Internet Bug Bounty programme on HackerOne, and a bounty of 2,540 USD was paid.

Setup

The report does not describe any special accounts, roles or tooling. The only precondition is a logged-in Argo CD web session and the ability to open a web terminal session, which the researcher describes as being used to operate a machine. The affected range is every version from v2.6.0 onwards.

Finding it

The researcher noticed that the web terminal session does not expire even when the Argo CD web session has expired. In other words, the lifetime of the terminal connection is not tied to the lifetime of the session that authorised it. The program's summary frames the same observation from the attacker's side: a user can send any websocket messages even if the token has already expired.

Exploitation

Step 1: Log in to Argo CD

The researcher logs in to Argo CD, establishing a normal web session.

Step 2: Open a web terminal session

With the session active, the researcher opens a web terminal session in Argo CD, which is used to operate a machine. This is the websocket-backed terminal view in the UI.

Step 3: Wait for the web session to expire

The researcher waits until the web session expires. The web terminal session does not expire with it, and the terminal remains usable. The program's summary states that this allows the user to send any websocket messages even after the token has expired.

The report includes a screen recording of the behaviour, named argocd-web-based-terminal-JWT.mp4, which shows the web terminal session outliving the web session.

argocd-web-based-terminal-JWT.mp4 From the original on HackerOne

Root cause

The report does not describe the implementation. What it establishes is the behaviour: the web terminal session has a lifetime independent of the Argo CD web session, so an expired token does not terminate an already open terminal. The likely explanation is that the websocket connection is authorised once, when it is established, and is not re-checked against the token's expiry for the life of the connection.

Impact

The most straightforward scenario, as described in the report, is a user who opens the terminal view and leaves it open for an extended period. That user can continue to view sensitive information through the terminal even when they should already have been logged out. The same condition means websocket messages can still be sent after the token has expired.

Fix

A patch was released in the following Argo CD versions:

  • v2.6.14
  • v2.7.12
  • v2.8.1

Variants to test

  • Open a websocket-backed feature (terminal, log stream, live console) and let the web session expire. A positive result is that messages sent over the websocket are still processed after the token has expired.
  • Repeat the same test after an explicit logout rather than a passive expiry. A positive result is that the websocket continues to work when the session has been deliberately ended.
  • Check whether the connection is re-authorised periodically or only at handshake. A positive result is that no re-check occurs for the life of the connection.

Hunting notes

This kind of bug tends to hide in long-lived connections that are authorised once at handshake: terminals, log tailing, notifications and other streaming endpoints. The signal during recon is a feature that keeps a connection open while the rest of the application relies on short-lived sessions or tokens. The researcher demonstrated impact with a simple, reproducible sequence: log in, open the terminal, wait for the session to expire, and show that the terminal still works. The recording attached to the report shows the sequence.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

What happened, in plain words

Argo CD is a tool that helps teams deliver software to their servers automatically. It has a web page with a built-in terminal: a small window in the browser where you can type commands and run them on a machine, as if you were sitting in front of it. That terminal stays connected to the server through something called a websocket, which is a connection that stays open in both directions for as long as the page is open.

Normally, when you log in to a website, the site gives your browser a pass called a session or a token. After a while that pass expires, and the site should stop letting you do things. The researcher found that in Argo CD, the terminal window keeps working even after the pass has expired. You can keep sending messages through the terminal and keep seeing what comes back, long after you should have been logged out.

The weakness is classified as insufficient session expiration: the session is supposed to end, but something keeps working past that point. It was rated medium severity with a CVSS score of 4.7. The report was disclosed on 9 September 2023 under the Internet Bug Bounty programme on HackerOne, and a bounty of 2,540 USD was paid.

The pieces you need to know

Before the steps make sense, here are the few ideas the report relies on.

  • Argo CD: a continuous delivery tool for Kubernetes. In everyday terms, it is the system that takes the software your team has approved and puts it onto the servers that run it, and it gives you a web page to watch and control that process.
  • Kubernetes: the platform that runs containers (packaged applications) across many machines. You do not need to know how it works to follow the report; it is just the environment Argo CD manages.
  • Web terminal: a terminal is a text window where you type commands. A web terminal is that same window, but inside a browser page instead of on your own computer. It lets you operate a machine from the Argo CD interface.
  • Websocket: a connection between your browser and a server that stays open, so both sides can send messages at any time. A normal web page request is like sending a letter and getting a reply; a websocket is like a phone call that stays connected until someone hangs up.
  • Session: the period during which a website remembers that you are logged in. Think of it as a wristband you get at an event: while you wear it, you can come and go.
  • Token: the string of characters that proves your session is valid, usually stored by the browser and sent with each request. It is the stamp on the wristband. When the token expires, the stamp is no longer valid.
  • Session expiration: the point at which the site decides your login is too old and ends it. This is a safety measure so that someone who walks up to an unattended computer, or who gets hold of an old token, cannot keep using your account forever.
  • Insufficient session expiration: a vulnerability class where something that should stop working when the session ends keeps working anyway. The session is supposed to be over, but a part of the system still accepts it.

The finding

The researcher noticed one thing: the web terminal session does not expire, even when the Argo CD web session has expired. The terminal connection has its own lifetime, separate from the login that allowed it to start.

The programme's summary describes the same thing from the other side: a user can send any websocket messages even if the token has already expired. The terminal keeps accepting messages after the token has expired.

Setup

The report does not describe any special accounts, roles or tools. The only things needed are a logged-in Argo CD web session and the ability to open a web terminal session, which the researcher describes as being used to operate a machine. The affected range is every version of Argo CD from v2.6.0 onwards.

Reproducing it

The researcher gives three steps. Each one is there to set up the next.

Step 1: Log in to Argo CD

Text
Step 1: Log in to ArgoCD.

This line is the starting point: you sign in to Argo CD in your browser the normal way. Doing this creates the web session and the token that the rest of the test depends on. Without a valid login there is no session to expire, so there would be nothing to observe.

Step 2: Open a web terminal session

Text
Step 2: Open a web terminal session in ArgoCD, which is used to operate a machine.

With the session active, you open the terminal view in the Argo CD interface. This is the websocket-backed terminal that lets you operate a machine. This step matters because it opens the terminal connection that the rest of the test observes. The question the researcher is testing is what happens to that connection later.

Step 3: Wait for the web session to expire

Text
Step 3: Wait until the web session expires, but the web terminal session does not expire.

Here you simply wait. The web session reaches its expiry time, as it is designed to. The terminal session, however, does not expire with it: the connection stays usable. This is the bug. If the terminal had been tied to the session, it would have closed or stopped accepting messages at the same moment. Instead it keeps going.

The report includes a screen recording named argocd-web-based-terminal-JWT.mp4 that shows the web terminal session outliving the web session.

argocd-web-based-terminal-JWT.mp4 From the original on HackerOne

Why it happens

The report does not describe the implementation, so what follows is an explanation of the behaviour, not a reading of the code. The established fact is that the web terminal session has a lifetime independent of the Argo CD web session, so an expired token does not terminate an already open terminal.

The likely explanation is that the websocket connection is authorised once, when it is established, and is not re-checked against the token's expiry for the life of the connection. A useful comparison is a door that checks your badge when you walk in but never checks it again while you are inside: once you are through, the badge can expire and you can still move around.

Impact

The most straightforward scenario, as the report describes it, is a user who opens the terminal view and leaves it open for an extended period. That user can continue to view sensitive information through the terminal even when they should already have been logged out. The same condition means websocket messages can still be sent after the token has expired.

The impact is framed around the session that should have ended but did not: the terminal keeps showing and accepting things after the login behind it has lapsed.

The fix

A patch was released in the following Argo CD versions:

  • v2.6.14
  • v2.7.12
  • v2.8.1

Other places to look

These are variations on the same idea, useful if you want to test similar features.

  1. Open a websocket-backed feature (terminal, log stream, live console) and let the web session expire. A positive result is that messages sent over the websocket are still processed after the token has expired.
  2. Repeat the same test after an explicit logout rather than a passive expiry. A positive result is that the websocket continues to work when the session has been deliberately ended.
  3. Check whether the connection is re-authorised periodically or only at handshake. A positive result is that no re-check occurs for the life of the connection.

Notes for someone hunting this

This kind of bug tends to hide in long-lived connections that are authorised once at handshake: terminals, log tailing, notifications and other streaming endpoints. During recon, the signal is a feature that keeps a connection open while the rest of the application relies on short-lived sessions or tokens.

The researcher demonstrated impact with a simple, reproducible sequence: log in, open the terminal, wait for the session to expire, and show that the terminal still works. The recording attached to the report shows the sequence.

Glossary

  • Argo CD: a continuous delivery tool for Kubernetes, with a web interface for watching and controlling deployments.
  • Kubernetes: a platform for running packaged applications (containers) across many machines.
  • Web terminal: a terminal window inside a browser page that lets you type commands and operate a machine.
  • Websocket: a connection between browser and server that stays open so both sides can send messages at any time.
  • Token: the string of characters that proves your session is valid, sent with requests and checked by the server.
  • Session expiration: the point at which a site decides a login is too old and ends it.
  • Handshake: the initial exchange in which a connection is set up and, in this case, authorised.
  • CVSS score: a standard number from 0 to 10 that rates the severity of a vulnerability.
  • Medium severity: a severity band for vulnerabilities that are real but not the most serious.
  • Bounty: a payment made to a researcher who reports a valid vulnerability.
  • Internet Bug Bounty: a programme on HackerOne that pays for reports affecting widely used internet software.
  • HackerOne: a platform where researchers report vulnerabilities to organisations.
  • Disclosure: the point at which a report is made public.

More by bean-zhang

View all

1 more disclosed report, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.