Skip to content

example: add X-Trust human presence attestation middleware - #98602

Open
htl-syterme wants to merge 2 commits into
vercel:canaryfrom
htl-syterme:canary
Open

example: add X-Trust human presence attestation middleware#98602
htl-syterme wants to merge 2 commits into
vercel:canaryfrom
htl-syterme:canary

Conversation

@htl-syterme

Copy link
Copy Markdown

Adds an example showing X-Trust middleware integration for Next.js API routes.

X-Trust proves human presence via a signed HTTP header (HMAC-SHA256).
Complements Web Bot Auth — the IETF charter explicitly scopes human
verification as out-of-scope. X-Trust fills that gap.

  • Zero KYC, Zero PII
  • Annotate, never block (Doctrine AIR)
  • 120s TTL, score 0..1
  • Works alongside Cloudflare Turnstile (different layer)

OSS: https://github.com/htl-syterme/htl-core
JSR: https://jsr.io/@htl-syterme/htl-core

@vercel-security-reviewer

Copy link
Copy Markdown

Security review details

@@ -0,0 +1,35 @@
import { NextRequest, NextResponse } from "next/server";

const SECRET = process.env.HTL_SECRET ?? "";

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.

Middleware defaults the HMAC secret to an empty string when HTL_SECRET is unset, allowing anyone to forge a valid x-trust token and be annotated with an arbitrary trust score.

Fix on Vercel

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.

1 participant