epi052/feroxbuster · error
Empty key in query string
Error message
Empty key in query string
What it means
split_query splits a query string on `=` and requires a non-empty key before the first `=`. If the input starts with `=` (or the part before `=` is only whitespace after trimming), there is no parameter name to return, so it throws. This keeps CLI `--query` entries well-formed.
Solutions
- Add the missing key name before the `=` (e.g. `foo=bar` instead of `=bar`)
- Check the request file / CLI args for stray leading `=` characters and remove or fix them
- Validate each query entry matches `key=value` format before passing it to the parser
Example fix
// before xatu --query "=123" // after xatu --query "block=123"
Defensive patterns
Strategy: validation
Validate before calling
if !q.is_empty() && q != "=" && !q.starts_with('=') { /* safe to parse */ } Try / catch
match split_query(entry) {
Ok((k, v)) => insert_query(k, v),
Err(e) => eprintln!("invalid query entry '{entry}': {e}"),
} Prevention
- Always write query parameters as key=value with a non-empty key
- Check templated request files for variables that expand to empty names
- Validate entries against a `^[^=\s][^=]*=.+$`-style pattern before parsing
When it happens
Trigger: Calling split_query("=value") or split_query("=") with surrounding whitespace like split_query(" =value") — the key is empty after trim.
Common situations: Typos in CLI flags (`--query =foo` from a misplaced space), templated request files where a variable name was dropped (`={{value}}` collapsing to `=value`), or copy-paste errors losing the parameter name.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- Empty query string provided
- Empty header provided
- Empty header name provided
- Empty --request-file file provided
- Invalid request: Missing head/body separator
AI-assisted analysis of epi052/feroxbuster@1f595dab5c (2026-09-13).
Data as JSON: /api/errors/976f16291e4ce35e.
Report an issue: GitHub.
Appendix: source
Thrown at src/config/utils.rs:277
/// * `Result<(String, String)>` - A tuple containing the key and value as `String`s,
/// or an error if the input is invalid.
///
/// # Errors
///
/// This function will return an error if:
/// * The input string is empty or equal to `"="`.
/// * The key part of the query string is empty (i.e., if the string starts with `"="`).
pub fn split_query(query: &str) -> Result<(String, String)> {
if query.is_empty() || query == "=" {
bail!("Empty query string provided");
}
let mut split_val = query.split('=');
let name = split_val.next().unwrap().trim();
if name.is_empty() {
bail!("Empty key in query string");
}
let value = split_val.collect::<Vec<&str>>().join("=");
Ok((name.to_string(), value.to_string()))
}
/// Splits an HTTP header string into a key-value pair.
///
/// This function takes a header string in the format of `"Key: Value"` and splits it into
/// a tuple containing the key and value as separate strings. If the header string is
/// malformed (e.g., empty or missing a key), it returns an error.
///
/// # Arguments
///
/// * `header` - A string slice that holds the header string to be split.
///
/// # ReturnsView on GitHub (pinned to 1f595dab5c)