
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
turnstile-validator
Advanced tools
A TypeScript validator for Cloudflare Turnstile tokens.
npm install turnstile-validator
import TurnstileValidator from "turnstile-validator";
const validator = new TurnstileValidator("your_secret_key");
async function validateToken(token: string, clientIp?: string) {
try {
const result = await validator.validate(token, clientIp);
console.log(result);
// { success: true, challenge_ts: '2023-01-01T00:00:00Z', hostname: 'example.com', ... }
} catch (error) {
console.error("Validation failed:", error.message);
}
}
validateToken("user_response_token", "127.0.0.1");
new TurnstileValidator(secretKey: string)
Creates a new validator instance.
secretKey
: Your Cloudflare Turnstile secret keyvalidator.validate(token: string, clientIp?: string): Promise<TurnstileResponse>
Validates a Turnstile token.
token
: The user response token from the Turnstile widgetclientIp
: (Optional) The IP address of the userReturns a Promise that resolves to the Cloudflare API response.
interface TurnstileResponse {
success: boolean;
challenge_ts: string;
hostname: string;
error_codes?: string[];
action?: string;
cdata?: string;
}
npm install
npm test
npm run build
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A validator for Cloudflare Turnstile tokens
The npm package turnstile-validator receives a total of 45 weekly downloads. As such, turnstile-validator popularity was classified as not popular.
We found that turnstile-validator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.