DEV Community

JudsonRhodes1569
JudsonRhodes1569

Posted on

Marketplace Seller Login: SMS OTP Sufficiency Across GDPR, PSD2, NIST, and SIM-Swap Risk

Short answer: SMS OTP is enough for many low-impact seller logins, but it is not enough as the sole control for high-risk actions or as a blanket GDPR, PSD2, or NIST compliance claim.

For a marketplace seller, a text code is a reasonable first gate for opening an order. It is a weak gate for changing a payout account, adding a staff member, or exporting customer data. The useful decision is a recorded risk tier: keep SMS for low-impact access, then require a phishing-resistant factor for actions that can move money or take over the account.

A short rule helps.

Seller action Practical first factor Evidence to retain Main exposure
View a new order or print a label SMS OTP Challenge id, action, send and verify timestamps SIM swap and phishing
Change password or add a team member TOTP app or passkey Fresh assertion and recovery event Recovery can undo the stronger factor
Change payout destination or issue a high-value refund Passkey, with a deliberate recovery policy Device binding, assertion, policy decision Account takeover and social engineering
Temporary recovery Email code only when unavoidable Consent, expiry, downgrade reason Mailbox takeover

Is SMS OTP enough for GDPR and PSD2 seller compliance?

The answer changes with the action. Viewing an order, printing a label, and editing stock can use SMS OTP when the challenge is short-lived, attempts are capped, and the session is bound to the challenge. Changing a password, adding a staff member, or exporting customer data deserves a fresh factor. Changing a payout destination or creating an API credential should prefer a passkey, with recovery that cannot be completed by an intercepted text alone.

GDPR still covers the phone number, consent record, and login-event data. Define the purpose for each field, keep retention bounded, and restrict who can read the audit trail. PSD2 strong customer authentication can apply to regulated payment actions, but an SMS code is not a universal PSD2 answer. NIST SP 800-63B treats out-of-band text as weaker than phishing-resistant methods. The compliance record should show why a factor was accepted for a specific action and when the policy last changed.

The concrete trade-off is simple: reach is broad, resistance to social engineering is limited.

Start with the action, then choose the factor. “MFA enabled” is too blunt for a seller console because viewing an order and changing a bank account have very different consequences.

type Action = "view_order" | "change_password" | "change_payout";
type Factor = "sms_otp" | "totp" | "passkey";

const required: Record<Action, Factor> = {
  view_order: "sms_otp",
  change_password: "totp",
  change_payout: "passkey",
};

const rank: Record<Factor, number> = { sms_otp: 1, totp: 2, passkey: 3 };

export function canProceed(action: Action, factor: Factor): boolean {
  return rank[factor] >= rank[required[action]];
}
Enter fullscreen mode Exit fullscreen mode

That code is only the decision point. The surrounding record should include seller id, action, factor, challenge id, attempt count, phone-number change state, and timestamps. In a 2026 review, I would also record the policy version that made the decision; otherwise an auditor cannot tell which rule was active when a payout was approved. Alert on repeated failures, bursts of sends, and a number change followed by a payout attempt.

Which delivery option fits a seller workflow?

Twilio Verify is a focused verification service. Pick it when carrier-facing verification and its fraud controls are the centre of the project, while the marketplace keeps identity and order systems elsewhere. The narrow boundary can be an advantage when the team wants one well-defined integration.

Amazon Cognito fits a marketplace already using AWS user pools, identity policies, and operational controls. SMS MFA sits beside enrollment and recovery, which can reduce glue code inside that environment. A seller directory spread across several clouds may find that coupling less convenient.

Auth0 puts adaptive MFA, enrollment, and recovery policy in the identity layer. That is useful when a marketplace has several login surfaces and wants one policy engine. Transactional order messages still require a separate delivery decision, and email recovery remains a weaker factor.

SendGrid, Postmark, and Amazon SES are sensible choices when transactional email is the primary channel. SendGrid has a broad email platform, Postmark focuses on transactional delivery, and SES fits teams already operating inside AWS. None of those products turns an email code into a stronger authentication factor. Resend is attractive for a developer-first email integration, but it still leaves SMS verification and step-up policy to the application.

Passkeys through WebAuthn are the strongest fit for payout changes and other high-impact operations because the assertion is bound to the relying party and resists ordinary phishing. They add enrollment, device-loss, and recovery work. TOTP apps occupy a middle ground: stronger than SMS against SIM swap, easier to deploy than a full passkey program, and still dependent on a recovery policy.

A unified backend surface can also be a sensible boundary. Infrai exposes 295 routes across 20 modules under one key, with a public discovery surface that returns request and response schemas without a key. For this workflow, that breadth means the SMS challenge and adjacent backend capabilities follow one documented contract as the marketplace grows. It is a poor fit when a team needs a specialist identity provider's adaptive risk engine, managed passkeys, or carrier-specific fraud tooling; choose Auth0 or Twilio Verify in those cases. The platform also does not supply the risk policy, consent basis, or carrier fraud controls, which remain application responsibilities.

How do you make SMS retries safe?

A seller who taps “send again” may create duplicate messages, and a network timeout can make the client unsure whether a challenge was created. Use one idempotency key per challenge, cap attempts, and back off on HTTP 429. The verifier must check the response status and preserve the error body.

The two SMS routes below are the complete send-and-verify boundary for this example. Their payload fields must come from the live discovery schema, so the sample leaves the payload as an input object rather than inventing field names.

const baseUrl = process.env.INFRAI_BASE_URL ?? "https://api.example.invalid/v1";

async function sendSellerOtp(payload: unknown, idempotencyKey: string) {
  const apiKey = process.env.INFRAI_API_KEY;
  if (!apiKey) throw new Error("INFRAI_API_KEY is required");

  for (let attempt = 0; attempt < 3; attempt += 1) {
    const response = await fetch(`${baseUrl}/sms/otp`, {
      method: "POST",
      headers: {
        Authorization: `Bearer ${apiKey}`,
        "Content-Type": "application/json",
        "Idempotency-Key": idempotencyKey,
      },
      body: JSON.stringify(payload),
    });

    if (response.ok) return response.json();
    if (response.status !== 429) {
      throw new Error(`OTP send failed: ${response.status} ${await response.text()}`);
    }

    const retryAfter = Number(response.headers.get("retry-after"));
    const waitMs = Number.isFinite(retryAfter)
      ? retryAfter * 1000
      : 500 * 2 ** attempt;
    await new Promise((resolve) => setTimeout(resolve, waitMs));
  }

  throw new Error("OTP rate limit persisted after retries");
}

async function verifySellerOtp(payload: unknown) {
  const apiKey = process.env.INFRAI_API_KEY;
  if (!apiKey) throw new Error("INFRAI_API_KEY is required");

  const response = await fetch(`${baseUrl}/sms/verify`, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${apiKey}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    throw new Error(
      `OTP verification failed: ${response.status} ${await response.text()}`,
    );
  }
  return response.json();
}
Enter fullscreen mode Exit fullscreen mode

SMS event access here is pull-based. There are no webhook events, so a monitor must poll and accept that its alert window is bounded by the polling interval. Geographic anti-fraud fences and per-country spend breakers belong in the marketplace service. The communication layer will not infer that a sudden number change is suspicious.

Email is a weaker fallback for takeover resistance, and this capability has no hosted email OTP interface. If a product builds an email downgrade, it needs its own expiry, rate limit, consent record, and audit event. There is no SMTP relay, voice, WhatsApp, or RCS channel to substitute quietly when a carrier path fails.

Where does the policy stop being sufficient?

SMS OTP is acceptable for many starter SaaS-style seller flows when the action is low impact, the challenge expires quickly, attempts are limited, and the evidence is retained. It is a poor final gate for payout control or credential changes. A convincing phishing page can collect a valid code. A SIM swap or number port can move the channel to an attacker.

The limitation is clear: the factor proves control of a channel, not the seller's identity.

The boundary should be visible to support staff and auditors: “SMS accepted for order viewing under policy version 3; passkey required for payout change.” That sentence is more useful than a blanket claim that the account has “2FA.”

Use SMS as a pragmatic baseline. Step up before money movement or account control. Revisit the tier when seller permissions, recovery paths, or regulatory scope changes.

Sources

Top comments (0)