β¬’ DragonFlyBSD Kernel Audit
← triage Β· dashboard
DF-3275

Non-constant-time authentication compares: PAP password and CHAP response checked with early-exit bcmp

Summary

The PAP credential check 'bcmp(passwd, sp->hisauth.secret, passwd_len)' (:4356-4357, gated by exact length equality) and the CHAP-MD5 digest check 'bcmp(digest, value, value_len)' (:4077, value_len==16) use bcmp, which short-circuits on the first differing byte. A malicious authenticating peer measuring response latency of PAP_NAK vs PAP_ACK (or CHAP FAILURE timing) gets a classic byte-by-byte timing oracle on the shared secret/expected digest; the digest oracle reduces CHAP to offline brute-force, the PAP oracle leaks the cleartext password directly. Practical signal-to-noise over PPP links is the limiting factor (direct serial/HDLC links the realistic case). Legacy PPP bucket; PAP secrets frequently reused. Not verified (timing PoC out of scope for Low). Fix: consttime_memequal at both sites. [VERIFIED pass2: code property verbatim-certain but timing oracle not measurable on shared KVM about 1 cycle deltas below noise; hardening constant-time fix]

Discussion (0)

No comments yet.

PoC verification

Evidence pack

findings/poc/DF-3275 Β· 5 files
FileTypeDescriptionSize
README.md β€” 837 B ↓ raw
VERDICT.md β€” 2.0 KB ↓ raw
df3275.c β€” 2.9 KB view raw
manifest.json β€” 709 B view raw
verdict.json β€” 1.5 KB view raw

DF-3275 -- verification pack

Method: Code-line analysis + attempted live reproduction Status: NOT REPRODUCED | impact: none | confidence: likely

What this is

The PAP/CHAP compares are verbatim early-exit bcmp (4330-4336 / 4069-4071) - the code property is certain - but the timing oracle could NOT be measured on this shared-KVM guest: rejection time for a 16-byte compare is ~1 cycle regardless of prefix (memcmp differences below scheduler/clock noise). No remote timing channel demonstrated; treat as hardening.

Build

cc -O -o <prog> <prog>.c   (on the guest)

Run

(no arg)

(success criterion: see VERDICT.md)

Evidence

misc3.log DF-3275 (df3275 timing table: ~0.9-1.4 cycles/reject, non-monotone)

Kernel references: sys/net/sppp/if_spppsubr.c:4330-4336, sys/net/sppp/if_spppsubr.c:4069-4071

VERDICT.md
↓ download raw

DF-3275 -- VERDICT

NOT REPRODUCED (impact=none, confidence=likely) Guest: DragonFly dfbsd 6.5-DEVELOPMENT DragonFly 6.5-DEVELOPMENT #0: Thu Jul 2 06:02:54 UTC 2026 root@dfbsd:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64

Summary

The PAP/CHAP compares are verbatim early-exit bcmp (4330-4336 / 4069-4071) - the code property is certain - but the timing oracle could NOT be measured on this shared-KVM guest: rejection time for a 16-byte compare is ~1 cycle regardless of prefix (memcmp differences below scheduler/clock noise). No remote timing channel demonstrated; treat as hardening.

How it was verified

  • Method: Code-line analysis + attempted live reproduction
  • Kernel references: sys/net/sppp/if_spppsubr.c:4330-4336, sys/net/sppp/if_spppsubr.c:4069-4071
  • Evidence: misc3.log DF-3275 (df3275 timing table: ~0.9-1.4 cycles/reject, non-monotone)
  • Reachability: local-unpriv where noted in the summary; root-config for tun/lagg/carp/ipfw3/gre items; remote-facing for the packet parsers (wlan harnesses model the RX/TX path verbatim because the guest has no 802.11 hardware; precedent DF-0393/DF-0594/DF-0621/DF-0350).
  • Privesc assessment: no uid0 chain exists for any finding in this batch -- the memory-safety items are bounded info reads (kernleak bucket) or fault-injection-gated NULL derefs; nothing yields a write primitive or control over privileged state. The one panic-class live item (DF-3414) is root-only (SIOCIFDESTROY).

Fix

fix_status: not_testable -- Fix = constant-time compare (loop all bytes, accumulate XOR) at both sites; not A/B-able here since no oracle was measurable.

Fix status (batch validation)

Applied with the 36 sibling fix.diffs of this batch in findings/poc/_batch41/all_fixes.patch; single in-guest make -j6 nativekernel KERNCONF=X86_64_GENERIC completed RC=0 with zero errors under -Werror (full log: findings/poc/_batch41/fix_build8.log). Behavior A/B intentionally skipped for this Info-tier item.

(No fix.diff for this item: documented recommendation only - see Fix above.)

Fix verification

not_testable

Fix = constant-time compare (loop all bytes, accumulate XOR) at both sites; not A/B-able here since no oracle was measurable.

per-fix-DF-3275

Confirmed kernel references

Detail

Evidence (decisive lines)

misc3.log DF-3275 (df3275 timing table: ~0.9-1.4 cycles/reject, non-monotone)

Verdict

The PAP/CHAP compares are verbatim early-exit bcmp (4330-4336 / 4069-4071) - the code property is certain - but the timing oracle could NOT be measured on this shared-KVM guest: rejection time for a 16-byte compare is ~1 cycle regardless of prefix (memcmp differences below scheduler/clock noise). No remote timing channel demonstrated; treat as hardening.