Urgent.News

What's breaking now, across thousands of outlets.

Tech

Node.js Marketplace Verification: 6 Secure SMS OTP Login Flow Lockout and Replay Defenses

Short answer: design a secure SMS OTP login flow by putting rate limiting, retry control, lockout, and replay protection in your Node.js backend, before and after the provider call. For a marketplace that emails a generated service report as an attachment, possession of an OTP should unlock one narrowly scoped report action. It should not create reusable proof of identity. A provider can deliver…

Designing a secure SMS OTP login flow in Node.js involves implementing six key defenses before and after making a provider call. The provider sees only a destination and code transaction, while the marketplace sees additional details like account information, IP, and recent failures. These six gates, applied in order, include normalizing account and device identifiers, enforcing user, IP, and device budgets, checking for suppression, issuing a short-lived challenge, tracking failed attempts with temporary lockout, and consuming the challenge atomically before granting authorization.

The actual flow involves a seller requesting a vehicle service report to a buyer. The backend checks for suppression, evaluates rate limits, sends the OTP, stores a challenge that expires quickly, verifies the code once, and then authorizes the specific report generation and email delivery. The authorization should be narrowly scoped to prevent misuse, ensuring that an accepted OTP cannot silently authorize other actions like account recovery or payout changes.

To protect the provider call, use six controls in the following order: normalize identifiers, enforce user, IP, and device budgets, apply a country allowlist, run a suppression check, issue a short-lived challenge, and increment the attempt counter while imposing a temporary lockout. The specifics of these controls can vary based on fraud risk, support load, and local requirements, but the key principles of finite life, finite guesses, and exactly one successful consumption must be maintained.

Use an idempotency key for transport retries and back off exponentially when encountering HTTP 429 responses, ensuring that fast loops do not amplify abuse. The provider boundary should only pass validated request bodies against a live discovery schema, keeping the policy layer flexible and the API transport concerns distanced from the state machine decision logic.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Database Indexing – Part 1: How Indexes Help Find Data Faster

Recently, I was reading two books: Good Vibes, Good Life and The Mountain Is You . I usually forget things after some time 😅. So whenever I want to revisit something I've read, I go back to the book.

  • Database indexing improves data retrieval speed
  • PostgreSQL uses indexes to locate records quickly
  • Index Only Scan retrieves data directly from index

I almost rebuilt a project for the wrong reason, a 20 minute audit caught it

I have an iPhone-driving rig. An ESP32 board plugs into the phone over USB and plays human, screen taps, button presses, the works, so my local agent can actually operate the phone instead of just…

  • Reporter conducted 20-minute audit before planning rebuild
  • Audit found old code clean, no security issues
  • New rebuild justified by architectural improvements, not security

When a cert-manager Keystore Runs Behind a Password Change

cert-manager v1.21.2's API reference: "The keystore file will be updated immediately." After a password change, the keystores opened only with the old password throughout our 30-minute window.

  • Cert-manager v1.21.2 has keystore password change issue
  • Keystore entries remain encrypted for 30 minutes post-change
  • Certificate stays Ready=True, but entries stay encrypted

I Built SpeedPulse: An Open-Source Internet Speed Tester with ASP.NET Core 10 and TypeScript

I Built SpeedPulse: An Open-Source Internet Speed Tester with ASP.NET Core 10 and TypeScript After working on its testing interface, diagnostics, backend, and release pipeline, I'm excited to…

  • SpeedPulse v1.0.0, open-source internet speed tester launched
  • Features connection speed testing, interactive dashboard, developer labs
  • Available for download via GitHub Pages or self-hosted ASP.NET Core 10

More from Saturday 17 October →