F5 BIG-IP iRule and validation scripts that block and verify mitigation of CVE-2026-21589 path traversal in Atlassian Data Center products, including encoded payload variants.
Defensive tooling for CVE-2026-21589, the critical (CVSS 9.3) unauthenticated arbitrary-file-access vulnerability affecting multiple Atlassian Data Center products (Jira, Jira Service Management, Confluence, Bitbucket, Bamboo, Crowd, Crucible, Fisheye).
This repo helps you mitigate the flaw on an F5 BIG-IP and verify that the
mitigation actually blocks the real payloads — including the ..:: separator and
single/double/triple-encoded evasion variants. It is not an exploitation
framework: the probe reports only HTTP status and response size and never stores
or prints a response body.
Patch first. These are stopgaps. Atlassian's fix is to upgrade to a fixed version. Use this toolkit to buy time until you can patch and to confirm your interim WAF rule holds — not as a substitute for patching. See the Atlassian advisory.
| File | What it is |
|---|---|
cve-2026-21589.irule | F5 BIG-IP iRule that blocks the traversal pattern on the request path — raw and normalized — behind a cheap string pre-filter. Based on Atlassian's published regex. |
benign-traffic.sh | Generates a steady stream of benign requests (Apache Bench) as baseline "normal" traffic. Ctrl-C or a minute limit. |
check-mitigation.sh | One-shot check: sends all 30 payloads (27 traversal, 3 benign controls) once each and prints a color-coded PASS / FAIL per row plus a summary. Bodies are never stored. |
probe-mitigation.sh | Sends the known CVE-2026-21589 payloads (curl, random 0–5 s jitter) and reports BLOCKED / INCONCLUSIVE / NOT BLOCKED per path. Bodies are never stored. Ctrl-C or a minute limit. |
The rule applies a contains ".." || contains "%" pre-filter so the regex only
runs on suspicious requests, then matches Atlassian's case-insensitive regex
against the path in two forms: as received (HTTP::path) and after TMM
normalization (HTTP::path -normalized). On a match it returns a hardened 403.
when RULE_INIT {
set static::trav_rx {(?is).*(?:/|\\|::|%(?:25)*(?:2f|5c)|(?::|%(?:25)*3a){2})(?:\.|%(?:25)*2e){2}(?:/|\\|::|%(?:25)*(?:2f|5c)|(?::|%(?:25)*3a){2}|;|%(?:25)*3b|$).*}
}
when HTTP_REQUEST priority 100 {
if { !(([HTTP::path] contains "..") || ([HTTP::path] contains "%"))} {return}
if { [regexp -- $static::trav_rx [HTTP::path]] || [regexp -- $static::trav_rx [HTTP::path -normalized]] } {
# log local0.warn "CVE-2026-21589 block: [IP::client_addr] [HTTP::path]"
HTTP::respond 403 -version auto content "Forbidden" noserver Connection "close"
return
}
}
if { !(([HTTP::path] contains "..") || ([HTTP::path] contains "%"))} {return}
This line is a fast path, not part of the detection logic. It exists for three reasons:
.*, is evaluated up to twice, and the second
evaluation also makes TMM build the normalized path. A contains test is a
plain substring search and far cheaper. Almost all real traffic contains
neither .. nor %, so it leaves the rule after two substring checks and never
touches the regex engine or the normalizer.. or as an encoded
%2e (%252e, ...). If both dots are literal, the path contains ..; if
either is encoded, it contains %. The other separators that need encoding
(%2f, %5c, %3a, %3b) also contain %. The normalized branch is
covered too: normalization only decodes % sequences and resolves dot
segments, so a raw path with no % and no .. cannot normalize into
something the regex would match. Any request that can match is therefore let
through to the regex.The pre-filter is intentionally loose. Benign paths such as /x/file..txt or
any URL with a %-encoded character pass it and fall through to the regex,
which then decides. That is why the benign controls in check-mitigation.sh
must come back as anything but 403: they prove the regex, not the pre-filter,
is what separates traversal from ordinary dots and encodings.
HTTP::path catches the payload as sent: literal .., and single- or
multiply-%25-nested dots (%2e, %252e, %25252e), which the
%(?:25)*2e sub-pattern matches directly.HTTP::path -normalized decodes the encodings the raw form hides —
including the digit-encoded %25%32%65 variant, which the raw regex misses
because it expects the literal bytes 2e. Normalization turns those encodings
back into %2e/.. so the same regex catches them. Note that :: is not a
separator to TMM's normalizer, so it does not collapse the CVE's ..:: chains —
which is what keeps the pattern visible to the regex rather than resolving it
away.Build details:
(?i) flag, so %2E, %5C, %3A match
their lowercase forms. Only the hex digits and separators have letters to fold;
.., /, \, ::, ; have no case, so (?i) only affects the encoded parts.
The pre-filter tests .. and %, both case-neutral, so it needs no folding.RULE_INIT into static::trav_rx, shared across requests.noserver version auto strips the server header from the 403.Scope — deliberately CVE-2026-21589 only:
HTTP::path is the complete surface for this CVE, and skipping
the query string is correct, not a gap. This rule is not a general-purpose
traversal filter and should not be relied on as one.Point everything at a host you own or are explicitly authorised to test.
Baseline traffic for 60 minutes:
printf '10.200.96.91\nhttp\n60\n\n' | bash benign-traffic.sh
One-shot mitigation check (prompts for target and scheme):
printf '10.200.96.91\nhttp\n' | bash check-mitigation.sh
Mitigation probe for 60 minutes:
printf '10.200.96.91\nhttp\n60\n' | bash probe-mitigation.sh
Reading the check output:
RESULT, the HTTP CODE, the EXPECTed behaviour and the
path (truncated to 70 characters).BLOCK rows PASS only on 403. Any other code is a FAIL: the
traversal payload got past the iRule.ALLOW rows are the benign controls and PASS on anything but 403. A
403 here is a FAIL: a false positive.All 30 payloads handled correctly. or a PASS/FAIL count.The three benign controls in check-mitigation.sh:
| Path | Why it must not be blocked |
|---|---|
/x/file..txt | .. inside a filename, not a path segment. Passes the pre-filter, but the regex needs a separator before and after the dots. |
/x/FILE..TXT | Same, upper case, to show the case-insensitive flag does not widen the match. |
/%78%2f%66%69%6c%65%2e%2e%74%78%74 | /x/file..txt fully hex-encoded, including the dots (%2e%2e) and the slash (%2f). The raw branch sees %2e%2e preceded by %65 (e), not a separator; the normalized branch decodes it to /x/file..txt. Neither matches, so this proves heavy encoding alone does not trigger a block. |
Reading the probe output: