Check the whitelist by SSID before every rogue M2 answer #5

Merged
aluminum-ice merged 2 commits from whitelist-by-name into master 2026-11-18 14:23:38 +00:00
Owner

What this PR does

Checks the whitelist by SSID before every rogue M2 answer, and stops a whitelist SSID that isn't a valid glob from crashing AngryOxide. Upstream: Ragnt/AngryOxide#82.

WhiteList::matches_ssid(&str) (src/whitelist.rs)

  • It is true when an SSID entry matches the name, whether or not an AP with that SSID is in the access point list.
  • An empty list matches nothing; the existing is_whitelisted_ssid returns true for an empty list.
  • It uses the same glob rule as whitelist_match. A MAC entry counts once its AP has been seen, which adds that AP's SSID to the list, as before.

Where it is checked

  • rogue_m2_attack_directed and rogue_m2_attack_undirected (named probe): no probe response for a whitelisted SSID. The existing check on a matching AP stays.
  • The anonymous path in rogue_m2_attack_undirected now skips a whitelisted AP.
  • The AssociationRequest handler sends no association response and no M1 to a client that asks the rogue AP for a whitelisted SSID.

Invalid patterns (first commit)

  • WhiteSSID::whitelist_match called Glob::new(..).unwrap(), which panics on an SSID that isn't a valid glob (an unclosed [, such as Cafe [Guest).
  • Such an entry now matches only that exact SSID (ssid_entry_matches).
  • targets.rs and devices.rs::get_device_by_ssid_glob have the same unwrap on target patterns; they're left for a separate change.

Checks

  • cargo build --release --locked: builds. The only warning in this crate (src/advancedtable/advtable.rs:659) is on master too.
  • cargo test --release --locked: 9 passed (the 4 existing and 5 new): glob entries, an invalid pattern matching itself (and Glob::new rejecting it), matches_ssid with no AP, an empty list, and a MAC entry counting once its AP is seen.
  • clippy and rustfmt weren't available on this host.

Still to do before release

  • Merge, then tag v0.9.5 so CI builds the aarch64-musl tarball.
  • Kestrel pins it in its next reflash-class release (1.0.15). Until then, Kestrel's launcher keeps rogue M2 off with a whitelist on older builds (Kestrel PR #204).
  • Send the same two commits upstream as a PR referencing #82.

🤖 Generated with Claude Code

## What this PR does Checks the whitelist by SSID before every rogue M2 answer, and stops a whitelist SSID that isn't a valid glob from crashing AngryOxide. Upstream: Ragnt/AngryOxide#82. **`WhiteList::matches_ssid(&str)`** (`src/whitelist.rs`) - It is true when an SSID entry matches the name, whether or not an AP with that SSID is in the access point list. - An empty list matches nothing; the existing `is_whitelisted_ssid` returns true for an empty list. - It uses the same glob rule as `whitelist_match`. A MAC entry counts once its AP has been seen, which adds that AP's SSID to the list, as before. **Where it is checked** - `rogue_m2_attack_directed` and `rogue_m2_attack_undirected` (named probe): no probe response for a whitelisted SSID. The existing check on a matching AP stays. - The anonymous path in `rogue_m2_attack_undirected` now skips a whitelisted AP. - The `AssociationRequest` handler sends no association response and no M1 to a client that asks the rogue AP for a whitelisted SSID. **Invalid patterns** (first commit) - `WhiteSSID::whitelist_match` called `Glob::new(..).unwrap()`, which panics on an SSID that isn't a valid glob (an unclosed `[`, such as `Cafe [Guest`). - Such an entry now matches only that exact SSID (`ssid_entry_matches`). - `targets.rs` and `devices.rs::get_device_by_ssid_glob` have the same `unwrap` on target patterns; they're left for a separate change. ## Checks - `cargo build --release --locked`: builds. The only warning in this crate (`src/advancedtable/advtable.rs:659`) is on `master` too. - `cargo test --release --locked`: 9 passed (the 4 existing and 5 new): glob entries, an invalid pattern matching itself (and `Glob::new` rejecting it), `matches_ssid` with no AP, an empty list, and a MAC entry counting once its AP is seen. - clippy and rustfmt weren't available on this host. ## Still to do before release - Merge, then tag v0.9.5 so CI builds the aarch64-musl tarball. - Kestrel pins it in its next reflash-class release (1.0.15). Until then, Kestrel's launcher keeps rogue M2 off with a whitelist on older builds ([Kestrel PR #204](https://git.3ntropy.io/aluminum-ice/kestrel/pulls/204)). - Send the same two commits upstream as a PR referencing #82. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A whitelist SSID entry is matched as a glob pattern. An SSID that isn't a
valid pattern, such as one with an unclosed "[", made Glob::new(...).unwrap()
panic the first time an AP was checked against the list. Such an entry now
matches only that exact SSID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rogue M2 attack answers a client for an SSID. It now checks that SSID
against the whitelist's SSID entries itself (WhiteList::matches_ssid), not
only through an AP of that SSID in the access point list, which may not have
been seen yet:

- a directed or undirected probe for a whitelisted SSID gets no probe
  response;
- the anonymous path skips an AP that is whitelisted;
- an association request to the rogue AP for a whitelisted SSID gets no
  association response and no M1.

A MAC entry counts once its AP has been seen, as before: that adds the AP's
SSID to the list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aluminum-ice deleted branch whitelist-by-name 2026-11-18 14:23:39 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aluminum-ice/AngryOxide!5
No description provided.