Razorpay payment signature verification check

Drop your project or paste the route that handles the Razorpay Checkout response to check that razorpay_signature is verified before the order is marked paid.

Run the check

Drop a project folder or files here

node_modules, .git, virtualenvs and build folders are skipped. Limit 25 MB / 5,000 files.

The Python engine (Pyodide, a few MB, cached by your browser) loads when you start.

The mistake

After Razorpay Checkout, the browser posts razorpay_payment_id, razorpay_order_id and razorpay_signature to your server. The mistake is marking the order paid without checking the signature.

Why it is dangerous

Everything in that request comes from the client. If the server does not check that razorpay_signature equals HMAC-SHA256(order_id + "|" + payment_id, key_secret), anyone can post a made-up or someone else's payment id (or a cheap payment against an expensive order) and get the product.

How to fix it

Verify the signature against the order id you created and stored, then trust the amount from your own order record (or fetch the payment from Razorpay), never from the client:

// Node
const { validatePaymentVerification } = require("razorpay/dist/utils/razorpay-utils");
const ok = validatePaymentVerification(
  { order_id: order.razorpayOrderId, payment_id: razorpay_payment_id },
  razorpay_signature, process.env.RAZORPAY_KEY_SECRET);
if (!ok) return res.status(400).json({ error: "invalid signature" });

# Python (raises SignatureVerificationError)
client.utility.verify_payment_signature({
    "razorpay_order_id": order.razorpay_order_id,
    "razorpay_payment_id": payment_id,
    "razorpay_signature": signature})

What this checker looks for

This page runs webhook-check, which reads route handlers in Next.js, Express, Fastify, Hono, FastAPI, Flask and Django. The rules most relevant to this page:

RuleWhat it finds
WHK006Razorpay payment trusted without verifying razorpay_signature
WHK003Signature compared with == instead of a constant-time comparison
WHK004Hard-coded webhook signing secret
WHK005Signature verification failure is ignored

Every finding has a rule id, a severity, file:line, the offending line (secrets masked), why it matters and how to fix it. Run webhook-check rules for the full list.

FAQ

Why is this rated critical?

Because a forged success request gets the product without paying. The check (WHK006) is only reported when the handler trusts the payment without verifying razorpay_signature.

Which key signs the payment response?

Your Razorpay key secret (not the webhook secret): HMAC-SHA256 of order_id + "|" + payment_id.

Are my files uploaded anywhere?

No. The checker is Python running inside your browser tab (Pyodide, WebAssembly). Your files are read with the browser's File API and written into an in-memory file system that exists only in this tab. Your files are never sent anywhere. The only network requests load the Python runtime and the checker code, plus Google Analytics page-view counting, which never sees your files. You can disconnect from the internet after the engine has loaded and the scan still works.

Is a clean report a guarantee?

No. It is a static check for known patterns, not a penetration test. A clean report means none of these patterns were found, nothing more.

Can I run the same check on my machine or in CI?

Yes. Every checker on this site is an open-source command-line tool (MIT licence, Python 3.10+ standard library only). The results here are the same as `scan --json` on the command line, except for checks that need git (whether a file is committed or ignored), which cannot run in a browser.