Potential memory-leak in misskey streaming
What happened?
The entire instance was unresponsive because of /streaming endpoint attack, and the ram usage was extremely high
What did you expect to happen?
Nothing
Version
2025.2.2
What type of issue is this?
Backend issue
What browser are you using? (Client-side issues only)
What operating system are you using? (Client-side issues only)
How do you deploy Sharkey on your server? (Server-side issues only)
With docker, docker compose to be precise
What operating system are you using? (Server-side issues only)
Debian 12
Relevant log output
[errors]: [ ReplyError: ERR increment or decrement would overflow
]
at parseError (/sharkey/node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/sharkey/node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js:302:14)
AggregateError: Redis error: failed to execute command(s): 'Error in command 0: ReplyError: ERR increment or decrement would overflow' at SkRateLimiterService.executeRedisMulti (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:281:19) at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SkRateLimiterService.limitBucket (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:138:29)
at async SkRateLimiterService.limitLegacyMinMax (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:101:16) SkRateLimiterService.limitLegacy (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:77:20) SkRateLimiterService.limit (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:70:20)
at async
at async
at async StreamingApiServerService.rateLimit This (file:///sharkey/packages/backend/built/server/api/StreamingApiServerService.js:75:27) at async Connection.onWsConnectionMessage
[errors]: [
]
(file:///sharkey/packages/backend/built/server/api/stream/Connection.js:115:41) {
ReplyError: ERR increment or decrement would overflow
at parseError (sharkey/node_modules/.pnpm/redis-parser@3.8.8/node_modules/redis-parser/lib/parser.js:179:12)
at parseType (/sharkey/node_modules/.pnpm/redis-parser 3.0.0/node_modules/redis-parser/lib/parser.js:382:14)
AggregateError: Redis error: failed to execute command(s): 'Error in command 0: ReplyError: ERR increment or decrement would overflow' at SkRateLimiterService.executeRedisMulti (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:281:19) at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SkRateLimiterService.limitBucket (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:138:29)
at async SkRateLimiterService.limitLegacyMinMax (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:101:16)
at async SkRateLimiterService.limitLegacy (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:77:20)
at async SkRateLimiterService.limit (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:70:20) at async StreamingApiServerService.rateLimitThis
(file:///sharkey/packages/backend/built/server/api/StreamingApiServerService.js:75:27)
at async Connection.onWsConnection Message (file:///sharkey/packages/backend/built/server/api/stream/Connection.js:115:41) { [errors]: [ ReplyError: ERR increment or decrement would overflow
]
at parseError (/sharkey/node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/sharkey/node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js:302:14)
AggregateError: Redis error: failed to execute command(s): 'Error in command 0: ReplyError: ERR increment or decrement would overflow' at SkRateLimiterService.executeRedisMulti (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:281:19) at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async SkRateLimiterService.limitBucket (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:138:29)
at async SkRateLimiterService.limitLegacyMinMax (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:101:16)
at async SkRateLimiterService.limitLegacy (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:77:20)
at async SkRateLimiterService.limit (file:///sharkey/packages/backend/built/server/SkRateLimiterService.js:70:20)
at async StreamingApiServerService.rateLimit This (file:///sharkey/packages/backend/built/server/api/StreamingApiServerService.js:75:27) at async Connection.onWsConnectionMessage (file:///sharkey/packages/backend/built/server/api/stream/Connection.js:115:41) { [errors]: [
]
ReplyError: ERR increment or decrement would overflow
at parseError (/sharkey/node_modules/.pnpm/redis-parser@3.0.0/node_modules/redis-parser/lib/parser.js:179:12) at parseType (/sharkey/node_modules/.pnpm/redis-parser 3.0.0/node_modules/redis-parser/lib/parser.js:382:14)
** Logs from streaming **
WARN * [streaming] Closing a connection (IP 172.70.47.92) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 141.101.76.185) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.71.183.193) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.166.143) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.172.30) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.70.46.102) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.170.77) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.170.145) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.166.30) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.71.99.169) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.71.99.222) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.70.47.56) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.170.9) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.70.47.187) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.71.95.111) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 104.23.170.43) due to an excessive influx of messages.
WARN * [streaming] Closing a connection (IP 172.71.99.21) due to an excessive influx of messages.
Contribution Guidelines
By submitting this issue, you agree to follow our Contribution Guidelines
- I agree to follow this project's Contribution Guidelines
- I have searched the issue tracker for similar issues, and this is not a duplicate.