fix(corewlan): detect redaction from the data, not the status - #13
Merged
Conversation
A scan could return with every SSID and BSSID stripped and still be reported as success, because the check was the authorization status alone. CoreWLAN redacts according to the calling process's own client identity, and a bundled executable launched directly rather than through LaunchServices is a different client from its bundle. So the manager can truthfully report that the bundle holds the grant while the scan it hands back is stripped. Observed on macOS 27.0: status authorized, thirteen networks, not one identifier among them. DecodeScan now also treats a scan that found networks and named none of them as ErrLocationDenied. A real observation always carries a BSSID, so that state is unambiguous. An empty airspace stays a successful empty scan — there is nothing to strip. This is the failure the package exists to prevent: silently recording signal strengths against nameless BSSIDs, which for a survey looks exactly like data.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
DecodeScantrusted the authorization status. That is not sufficient, and the failure is silent.CoreWLAN redacts according to the calling process's own client identity. A bundled executable launched directly — rather than through LaunchServices — is a different CoreWLAN client from its bundle. So the manager can truthfully report that the bundle holds the grant, while the scan it hands back is stripped.
Observed on macOS 27.0 running Trellis's capture binary directly out of its signed, entitled, authorized bundle:
No error. Correct RSSI, correct channels, correct security — and nothing nameable. For a survey product that is worse than a failure: it records a walk of nameless BSSIDs that looks exactly like data.
Fix
DecodeScanalso returnsErrLocationDeniedwhen a scan found networks and named none of them. A real observation always carries a BSSID, so that state is unambiguous.An empty airspace stays a successful empty scan — there is nothing to strip, so
len == 0is not redaction.Tests
Two added:
ErrLocationDeniedgofmt·go vet·golangci-lint0 issues ·go test -race· darwin and linux build.Consumers
Both seed and trellis get this for free on the next bump; neither needs a code change. Seed's helper is launched by launchd from a plist that names the inner binary, which is exactly the shape that can hit this.