# DoS via large console messages

Oversized slash-command payload logged verbatim to console exceeds 64KB, hanging the Mattermost server for all users.

- Payout: $150
- Severity: low
- Program: Mattermost
- Found by: thesecuritydev
- Disclosed: 2022-04-29
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1243724
- Library page: https://bugbountylibrary.com/r/h1%3A1243724
- Tags: area:web domain:web impact:dos kind:bounty platform:hackerone sev:low tech:go technique:source-review vuln:dos

**Target:** Mattermost server /api/v4/commands/execute endpoint and console logger
**Root cause:** The API accepts unbounded command values and the invalid-command error handler logs the full payload to console; console logging chokes on messages over ~64KB, blocking the server.
**Steps:**
1. Enable console logging at debug level on a test server.
2. Intercept a POST to `/api/v4/commands/execute` with JSON body containing a `command` value.
3. Replace `command` with a non-existent slash command padded to >66,000 characters, e.g. `/0000...`.
4. Send the request; server logs the invalid command error including the huge payload.
5. Server becomes unresponsive for all users until restarted with `make run-server`.
**How found:** Noticed that invalid slash commands are echoed into error logs, and that the API lacks the size limit enforced by the UI text box; hypothesized a large payload would overwhelm console logging.
**Exploitation:** Attacker sends a single authenticated POST to /api/v4/commands/execute with a >66KB invalid command string; the error log write blocks the console logger and hangs the server. Repeating the request on recovery sustains the outage.
**Insight:** UI-side length limits often aren't enforced server-side; look for endpoints that echo user input into logs and test whether log sinks (console, SQL query logging) have message-size limits that can be exceeded to stall the process.

## Proof of concept (copied exactly from the original report)

**POST to commands/execute with oversized command payload**

```
POST request to `/api/v4/commands/execute` with a JSON body with a `command` value.
6. Send the request to the Repeater in Burp Suite.
7. _The vulnerability comes from the fact that if you type a non-existent command, it will log an error that includes the command you gave. There is no size limit on the command value in the API directly (only in the text box)._
8. Replace the command value with `/000000000000000000000000000000000000000000000000000000000000000...`, where you use more than ~64KB of text
```

