Closed Bug 2046944 Opened 5 months ago Closed 5 months ago

about:webauthn listen() passes manage() a ~16.7 hour timeout (60 * 1000 * 1000 ms) instead of ~60 seconds

Categories

(Core :: DOM: Web Authentication, defect)

defect

Tracking

()

RESOLVED FIXED
153 Branch
Tracking Status
firefox153 --- fixed

People

(Reporter: florian, Assigned: jschanck)

References

Details

Attachments

(1 external file)

In AuthrsService::listen() (dom/webauthn/authrs_bridge/src/lib.rs), the interactive management session is started with:

self.usb_token_manager.lock().unwrap().manage(60 * 1000 * 1000, status_tx, state_callback);

That timeout flows through StateMachine::manage -> Transaction::new -> RunLoop::new_with_timeout(fun, timeout_ms), which treats it as milliseconds (Duration::from_millis(timeout_ms) in the runloop crate). The sibling register() and sign() calls pass timeout_ms (the WebAuthn request timeout, in ms), confirming the unit.

60 * 1000 * 1000 = 60,000,000 ms is about 16.7 hours. The expression reads like "60 seconds in microseconds", so the intended value was almost certainly 60 * 1000 (60,000 ms = 60 s). As written, the device-discovery RunLoop timeout is effectively never reached, so the listen() device monitor never self-terminates; it stops only when explicitly cancelled.

This is why the shutdown hang in bug 2046936 was unbounded rather than self-resolving after ~60s.

Suggested fix: pass 60 * 1000 (or the intended bound) to manage().

Assignee: nobody → jschanck
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 153 Branch
QA Whiteboard: [qa-triage-done-c154/b153]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: