
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
express-recaptcha-rest
Advanced tools
Protect public routes from spam through recaptcha
The motivation behind this module was to protect an api endpoint, for user signups from spam. Therefore this module does not deal with the client side of recaptcha at all.
Install the module with npm
npm install -save express-recaptcha-rest
Once installed require it and add it as middleware to a route.
const express = require('express')
const recaptcha = require('express-recaptcha-rest')
const app = express()
app.post('/some/route', recaptcha({ secret: 'your_secret' }), routeHandler)
field
secret
If the recaptcha response supplied by the client is invalid the middleware ends the response with a 422 status. Middleware and handlers which are further down the line won't get executed.
If the client does not send any recaptcha response at all or not under the in options specified key the response will end with a 400 status.
The middleware adds a req.recaptcha
property to the request.
This property holds the response from the verification request.
If the middleware finds req.recaptcha
set to false, by an early
middleware, verification will be skipped.
The following errors will be passed to next as the only argument.
This error indicates that the verification request could not be sent.
Should the response to the verification request have any other status than 200 this error is given.
If the JSON in the body of the response can not be parsed you will see this error.
This error shows that the request it self was invalid, most likely an invalid recaptcha secret.
FAQs
Protect public routes from spam through recaptcha
We found that express-recaptcha-rest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.