Skip to content

Commit ea218a8

Browse files
committed
smaller improvements in docs
1 parent e300314 commit ea218a8

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

documentation/README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ embedding model and storing them in a vector database for efficient retrieval. A
7474
is embedded, similar vectors are retrieved from the database with their textual representation, and those results are passed to an LLM to generate a
7575
context-aware response.
7676

77+
### Vulnerability
78+
7779
This attack vector is designed to mimic a genuine embedding-inversion attack.
7880
Classic inversion attacks reconstruct portions of a sentence by training a model to reverse the embedding vector,
7981
an approach that depends on each word’s semantic meaning being preserved in the embedding space.
@@ -87,7 +89,8 @@ In shared chat sessions, the embeddings can be read by the users who imported th
8789
by embedding all possible flag characters through the service and storing the resulting vectors.
8890
The flag can then be reconstructed.
8991

90-
### Attack Flow Chart
92+
### Exploit
93+
In order to exploit, the following steps are performed:
9194
```mermaid
9295
flowchart TD
9396
A["Get flag hint session ID"] --> B["Register an attacker user"]
@@ -117,6 +120,8 @@ In praxis, this means that the model would produce an Out-Of-Vocabulary (OOV) ve
117120
### Background
118121
This vulnerability exists in the custom authentication handshake, that is performed
119122
to obtain a special JWT that acts as authentication for MCP (Model Context Protocol) requests.
123+
124+
### Vulnerability
120125
The service implements a challenge-response authentication computing first a session key from the shared secret (the created access token), client and server challenge
121126
and later on using AES CFB8 encryption to generate client credentials from an all-zero IV and client credentials with the session key as key.
122127
Because the server challenge is randomly generated, the resulting session key is also effectively random and is then used to encrypt the IV and the client challenge.
@@ -129,8 +134,8 @@ also set to all zeros. The attacker is now authenticated.
129134
![Cryptographic All-Zero IV Vulnerability](assets/images/handshake_exploit.jpg)
130135

131136

132-
### Attack Flow Chart
133-
137+
### Exploit
138+
In order to exploit, the following steps are performed:
134139
```mermaid
135140
flowchart TD
136141
A["Get flag hint user and session ID"] --> B["Create 8 byte long all-zero client challenge"]
@@ -143,16 +148,17 @@ flowchart TD
143148
G -->|Yes| I["Receive JWT token"]
144149
H -->|Yes| C
145150
H -->|No| J["Attack failed after X attempts"]
146-
I --> K["Connect to MCP interface<br/>using JWT token in authentication header"]
151+
I --> K["Connect to MCP interface<br/>using JWT in authentication header"]
147152
K --> L["Read messages from<br/>target chat session"]
148153
L --> M["Extract flag from messages"]
149154
M --> N["Remove eventual padding characters"]
150155
N --> O["Success: Flag recovered"]
151-
152-
153156
```
157+
Since the handshake is performed in two successive steps, data has to be stored in on server-side in memory. The client
158+
receives in the first response a memory key that must be sent in the second request to continue the handshake.
159+
154160
### Fix
155-
To fix this vulnerability, the IV should be set to a random value instead of all-zero bytes.
161+
To fix this vulnerability, the IV should be initialized with a random for each handshake value instead of all-zero bytes.
156162

157163
# Potential Enhancements
158164
## OpenID Connect OAuth 2.0 Authorization Code Flow with PKCE

0 commit comments

Comments
 (0)