Skip to content

fix: fail closed when proof-of-life has no burst frames - #441

Merged
kilodesodiq-arch merged 4 commits into
ChainForgee:mainfrom
northersubair:fix/proof-of-life-selfie-only-fail-closed
Aug 22, 2026
Merged

fix: fail closed when proof-of-life has no burst frames#441
kilodesodiq-arch merged 4 commits into
ChainForgee:mainfrom
northersubair:fix/proof-of-life-selfie-only-fail-closed

Conversation

@northersubair

Copy link
Copy Markdown
Contributor

Summary

Selfie-only requests (no burst frames) previously passed liveness because the burst_required flag defaulted to satisfied when no frames were supplied, collapsing the anti-fraud signal to "a face is present".

Make liveness evidence a mandatory precondition: without burst frames, is_real_person is always false with a clear reason. Burst-based requests are scored on actual blink/head-movement evidence.

Closes #431

Testing

  • Selfie-only request (no burst frames) returns is_real_person: false
  • Selfie-only request reason mentions liveness
  • Empty burst list treated as selfie-only
  • Burst with blink/movement can pass; burst without liveness fails

Checklist

  • Tests added or updated for new/changed behavior
  • Existing tests pass
  • No secrets, keys, or seed phrases committed
  • Follows the coding conventions in the relevant service README
  • PR is focused on a single concern

northersubair and others added 4 commits August 20, 2026 13:57
Selfie-only requests (no burst frames) previously passed liveness
because the burst_required flag defaulted to satisfied when no
frames were supplied, collapsing the anti-spoon signal to 'a face
is present'.

Make liveness evidence a mandatory precondition: without burst
frames, is_real_person is always false with a clear reason.  Burst-
based requests are scored on actual blink/head-movement evidence.

Closes ChainForgee#431
The conftest was replacing proof_of_life with a MagicMock at module
level, causing all tests to get MagicMock objects instead of real
classes. The cascade classifier loading happens in __init__ (not at
module level), so the stub is unnecessary with mocked cv2.
Without mocking _detect_primary_face, the mock cv2 cascade returns no
faces, causing analyze() to return 'No face detected' before reaching
the burst-required liveness check. Adding the mock ensures the selfie-only
tests exercise the correct code path.

@kilodesodiq-arch kilodesodiq-arch left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kilodesodiq-arch
kilodesodiq-arch merged commit 158b081 into ChainForgee:main Aug 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proof-of-life passes a single static selfie: burst-free requests report is_real_person true with only face detection

3 participants