//nefariousplan

Out Of Band, Also In Band

A flow whose security depends on the secret traveling only over a trusted side channel (email, SMS, push) is implemented by a service function that hands the same mutable object to the side-channel sender and to the in-band HTTP response. The "out of band only" promise collapses into "out of band, also in band."

Forgot-password, magic-link, MFA enrollment, email-confirmation and account-recovery flows all rest on one invariant. The secret the server mints travels over exactly one channel, the trusted side channel, and the HTTP response the caller sees says nothing useful. Completing the flow requires reading the inbox, the SMS, or the push notification, which is the action that proves the caller controls the trusted address. The inbox is the credential.

The construction collapses the moment a single service function hands the same mutable object to the side-channel sender and to the in-band response. The side channel still fires. The response the unauthenticated caller receives also carries the secret. Out of band is still happening. It is now happening in band as well.

Mechanism

A flow built around a trusted side channel (SMTP inbox, SMS carrier, push provider, on-device authenticator) depends on the recipient of that channel being the credential. The HTTP caller asks for a secret and only ever receives an acknowledgement. Completing the flow requires observing the side channel, which is an action that requires control of the trusted address. This is not bearer-token authorization. The inbox is the token.

The failure mode is a service function that constructs the secret, hands it to the side-channel sender, and then returns the same object to its controller. The controller marshals that object into res.json, jsonify(...), Response(...) or the framework's equivalent. The serializer walks whatever it is given. The same token the server emailed is now reachable through the response body the unauthenticated caller already has. Two consumers, one object, no type to keep them apart.

The conflation usually ships because the service function's return value is the ORM entity or DTO the function hydrated. manager.save rehydrates the full row with every column. Active Record .save returns the full row. SQLAlchemy session.refresh returns the full row. The return statement reads return data, return user, return account, and the author's mental model is that the function has one caller. It has two. The side-channel sender uses one field (user.email, phone.number). The response serializer walks every field reachable from the object. The columns the sender ignored are the columns the response ships.

CVE-2025-58434 against Flowise is the canonical site. forgotPassword mints a tempToken, writes it to the user row via manager.save (which rehydrates data.user with every column including tempToken, tokenExpiry, and the bcrypt credential), builds a reset link, calls sendPasswordResetEmail(data.user.email!, resetLink), and finishes with return data. The controller is one line: return res.status(StatusCodes.CREATED).json(data). The token leaves on the trusted side channel exactly as designed. The token also leaves in the HTTP response body because res.json walks the AccountDTO and finds tempToken on it. Two unauthenticated POSTs take over any account whose email you know.

The pattern recurs across any flow whose security model is "we told you nothing, go read the inbox." Password reset, email verification, magic link login, MFA enrollment with server-generated seeds, invite acceptance, device registration, account recovery codes. It recurs because the ergonomic default in ORMs and DTO libraries is to return the full object and let the serializer handle shaping. Each new secret column added to the entity (webhook signing key, OAuth refresh token, MFA seed, recovery code set) expands a response payload nobody meant to expand. The function's signature does not record that one of its two callers is a hostile network boundary.

The short-term fix strips the secret-bearing columns before the serializer sees the object. Flowise's patch is a three-line sanitizeUser helper that deletes credential, tempToken and tokenExpiry, applied at every account-service return. It closes the current CVE. It does not close the class. The deeper fix is a typed view (UserResponse, AccountView, SessionView) whose shape omits the secret columns by construction, so the compiler rejects any attempt to hand the raw entity to the response boundary. The patch worth shipping does both.

Exhibits

CVE-2025-58434: Flowise Sent the Reset Token to the Inbox. It Also Sent It to the Caller.. Flowise's forgotPassword is the canonical instance. The function mints a temporary token, persists it on the User row via manager.save (which rehydrates the local variable with every column), emails the trusted address, and then returns the same mutated AccountDTO to the controller. The controller pipes it into res.json. The token that was supposed to ride only the SMTP channel ships in the HTTP body to whoever asked. Two consumers, one object, no type to keep them apart.

Boundaries

Not every secret-in-the-response is Rejection Echoes The Secret. That pattern's shape is the reject branch of an auth comparison emitting the expected value, often as a leftover debug print the author added to verify the comparison, that shipped because the reject branch is the path no developer re-reads. The function is failing and telling the caller what should have matched. Out Of Band, Also In Band fires on the success path of a silent-response flow: the comparison does not run, the handler reaches its return statement, and the serializer walks an object the function already handed to a trusted sender. The reject branch is not involved. The bug is in what the success branch returns.

Not every credential-in-the-response is Confirmation Was Conditional. That pattern's shape is a handler that branches at runtime on whether the OOB channel is configured: SMTP configured routes to invite, SMTP absent short-circuits to direct creation with the credential in the response body. The in-band path is a documented fallback the handler chose. Out Of Band, Also In Band has no branch. The OOB send fires, the trusted recipient receives the secret as intended, and the same object continues to the return statement that also populates the in-band response. Confirmation Was Conditional asks "which channel does the handler pick?" and the answer is sometimes in-band. Out Of Band, Also In Band asks "how many channels did this one call use?" and the answer is always two.

Not every wide-serialization-of-an-ORM-entity is Wide Default, Narrow Doc. That pattern names a forwarding component that copies its entire inbound structure into an outbound call, with documentation that enumerates only the configurable surface. The data flows through the component. Out Of Band, Also In Band is not about forwarding. The service function constructs the sensitive value server-side, then emits one object in two directions. The question is not "what did the component copy from input to output" but "how many distinct output boundaries did one return statement serve." A single-consumer handler that returns a wide ORM row to one network boundary is a disclosure bug; it is only this pattern when a trusted side channel has already carried the secret and the in-band response is the second copy.

Defender playbook

Audit every endpoint in the authentication and account surface for functions whose last two operations are a call to a side-channel sender and a return statement that hands the sender's input object back to the controller. Grep the codebase for sendPasswordResetEmail, sendVerificationEmail, sendMagicLink, sendInvite, sendOtp, sendMfaCode, sendRecoveryCode, and any project-local SMS or push helpers. For each hit, read the function back to its return line. If the variable passed to the sender is the variable the controller serializes, the function has two consumers of one object. That is the signature of this class, independent of language or framework.

Replace the ORM entity on the response boundary with a typed view object (UserResponse, AccountView, SessionView) whose shape omits every secret-bearing column by construction. Flowise's three-line sanitizeUser denylist is the right patch for the current CVE and the wrong fix for the class: the next column added to the User entity (a webhook signing secret, an OAuth refresh token, an MFA seed, a recovery-code set) will ship in the response until someone remembers to update the helper. A response type whose fields cannot include the token at compile time rejects the conflation at the signature level. Ship the denylist today, the view type next sprint.

Write a regression test that submits the OOB-gated endpoint as an unauthenticated caller, captures the outbound email, SMS, or push payload through a test-double transport, and asserts that the token emitted on the side channel does not appear anywhere in the HTTP response body. The assertion must compare the actual captured secret against the actual response bytes, not a hard-coded field name. Bugs of this class survive because the response body is not the output anyone was reading during review; a test that reads both the inbox and the response is the only durable guard against the next column.

Add a migration-time review gate for any new column added to a User, Account, Session, Credential, or Invite entity. For each new column, enumerate every endpoint that returns an instance of that entity and confirm the new column is either in the response view's allowlist or removed by the response sanitizer. Schema changes on authentication-adjacent entities are the recurring entry point for this class because the response-shaping code and the entity-shaping code live in different files, maintained by different reviewers, with no type-system enforcement between them. Make the coupling explicit at migration time or inherit it at CVE time.

Kinship

Trust Inversion. Parent. The side-channel sender is the privileged party in the flow: it holds SMTP credentials, speaks to a trusted address, and carries a fresh server-minted secret. When the same object rides the unprivileged response channel out, the tool that authorizes the user becomes the surface that bypasses the user. Out Of Band, Also In Band names the specific mechanism by which the inversion ships: dual-consumer conflation on the success path of a flow that was supposed to be silent in-band.

Rejection Echoes The Secret. Near sibling. Both patterns ship a server-side secret into the caller's response body. Rejection Echoes The Secret does it on the reject branch of a comparison, usually as a debug print that survived because the reject path is the path no developer re-reads. Out Of Band, Also In Band does it on the success branch of a flow whose success was supposed to be silent in-band. Different branches of the handler, same output boundary, same disclosure.

The server told two parties what the token was. One of them was supposed to hear it.