influxdata / influxdata/influxdb

Influx v2 RC - Potential DoS vulnerability in the HTTP API with (very) large query requests

Open
#19,680 4 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

area/2.x area/flux kind/bug rc-bugs security security/medium team/query
Dominant language
Rust
Stars
31.7k
Forks
3.7k
Avg merge
13h 37m
Merged PRs (30d)
8

Description

Haven't dug too deep into this, but if someone can double check/verify that would be helpful.

We noticed that doing Flux queries with a large number of filters consistently crashes our docker-based influx v2 instance.
AFAICT no slowly increasing memory ending in an OOM error or a cpu spinning out of control, just doing the query and a fraction of a second later, the container has exited and the client yields a Remote end closed connection without response error.
Noticed this in the beta and having it again in the RC.

the query in question is very simple in terms of structure:

from(bucket: "my_bucket")
                |> range(start: 1601424000, stop: 1601564069)
                |> filter(fn: (r) => r["_measurement"] == "my_measurement")
                |> filter(fn: (r) => r["_field"] == "myfield_0001"
                                        or r["_field"] == "myfield_0002"
                                        ...

Environment:

  • Docker 19.03.12 on Ubuntu 20.04
  • current quay.io/influxdb/influxdb:2.0.0-rc version
  • no special settings
  • /var/lib/influxdb mounted from host disk

Additional info:

  • The query that crashes the server has a few thousand of these or statements and is about 275 000 chars long (yep, that's developers for ya ;-))
  • the query is valid (and all fields exist)
  • I don't think there is anything with the fieldnames, the encoding, the data etc, because when we do the same query in chunks, it works fine for all of them.

The problem is of course not that there would be a limit to the number of characters, but that AFAICT there is a request size that can crash the server.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.