
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
csrf-monkey
Advanced tools
Monkeypatch xhr and fetch to automatically add csrf tokens to clientside requests
Clientside csrf made simple
npm install --save csrf-monkey
Default behaviour
Put your csrf token in a meta tag in your head like so:
<html>
<head>
<meta name='csrf-token' content='value'>
</head>
<body></body>
</html>
Then call csrf-monkey
to patch xhr and window.fetch to automatically include the csrf token in all requests
var axios = require('axios')
var csrfMonkey = require('csrf-monkey')
csrfMonkey()
fetch('/api') // request will include csrf header ('x-csrf-token': value)
axios.get('/api') // request will include csrf header ('x-csrf-token': value)
// csrfMonkey(header, token)
// you can also pass a custom header to csrf-monkey:
csrfMonkey('my-custom-csrf-header')
// and you can pass your csrf token value directly to csrf-monkey if you don't want to include it as a meta tag:
csrfMonkey('my-custom-csrf-header', 'my-csrf-token')
var restore = csrfMonkey()
restore() // Restores everything back to how it was
csrf-xhr
FAQs
Automatically add CSRF headers to all clientside requests
The npm package csrf-monkey receives a total of 0 weekly downloads. As such, csrf-monkey popularity was classified as not popular.
We found that csrf-monkey 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.