Skip to content

fix: match a leased SSO OTP by text, not by gateway sender - #58

Merged
Pigbibi merged 1 commit into
mainfrom
fix/lease-match-by-text
Nov 10, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
fix/lease-match-by-text

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 10, 2026

Copy link
Copy Markdown
Owner

AI assistance

WorkBuddy agent (DeepSeek-V4.1-Flash), directed by the repository owner.

What changed

  • src/pipeline.js: interceptPresetRules(preset, env, { leased }) now forwards the source, and guangdongSsoPresetRules applies GUANGDONG_SMS_SENDER only to the statically configured preset. Inside a workflow lease the rule matches on the SMS text evidence (验证码 plus one SSO marker) alone.
  • worker.js: findEffectiveInterceptRule returns { rule, leased, presets }; forwarding logs a structured intercept_decision event on silence, plus a no_rule_match_while_leased warning when a lease is held but nothing matches.
  • docs/configuration.md: documents the lease-vs-sender boundary.
  • Tests: preset-level cases in tests/pipeline.test.js and an end-to-end worker case in tests/worker-intercept.test.js.

Why

During a live Guangdong SSO re-login the portal sent the OTP, but the bot still forwarded it to Telegram, so the workflow had nothing to read and the code reached the human instead.

The lease was held: the sender guard was the only difference. Its configured value did not match the sender actually reported in the message, so the rule never matched and the OTP was forwarded. Sender IDs vary per carrier and gateway, so tying an explicitly leased window to that string turns a configuration drift into a silent code leak.

Scope is unchanged: with no lease, the preset does not apply and other SMS behave exactly as before; text evidence is still mandatory, so an unrelated OTP (bank, courier) is never silenced.

How verified

  • npm test — 66 passed.
  • npm run lint — clean (node --check for every source, test and the Pages relay).
  • New cases: leased + mismatched sender still silences; leased + non-SSO text still forwards; static preset keeps the sender guard.

A workflow lease is an explicit statement that one unified-identity OTP is
expected inside the window, yet the leased rule still required the
configured GUANGDONG_SMS_SENDER. Sender IDs differ per gateway, so a stale
value silently let the code reach Telegram during a live login, where the
workflow then had nothing to read.

Leased presets now match on the SMS text evidence only; the sender guard
stays on the statically configured preset. Decisions are logged as
structured intercept_decision events, including the case where a lease is
held but nothing matches, which is the leak that previously left no trace.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T10:00:27.609813Z 684b6b3 PR opened
🔒 Security Review ✅ Completed 2026-11-10T10:02:47.815257Z 684b6b3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Pigbibi
Pigbibi merged commit 498df7d into main Nov 10, 2026
11 checks passed
@Pigbibi
Pigbibi deleted the fix/lease-match-by-text branch November 10, 2026 10:03
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