influxdata / influxdata/influx-cli
Unvalidated duration input leads to signed integer overflow and confusing error message
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 75
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
This input probably isn’t expected, but I tried it on a whim. Validating inputs is a chore and clearly the REST endpoint is doing it (as expected), but not the CLI which performs an invalid conversion which leads to a confusing response since a negative input was not provided (though it may be out of bounds).
$ influx bucket update -i a0<redacted>54 -r 999999w --http-debug
…
{"retentionRules":[{"everySeconds":-3943159232,"type":"expire"}]}
…
Error: failed to update bucket "a0<redacted>54": 422 Unprocessable Entity: expiration seconds cannot be negative
Enabling debug output seems to indicate that the unchecked input leads to an signed integer overflow.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Go CLI handling for the influx bucket update command and its retention duration conversion; compare its behavior with validation at the REST endpoint. Reproduce the 999999w input with HTTP debug output, then verify that out-of-bounds durations are rejected before a signed overflow can produce a confusing server error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100