
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
jns-cloudflare
Advanced tools
jns-cloudflareCloudflare proxy support for @jnode/server.
npm i jns-cloudflare
const { createServer, routerConstructors: r, handlerConstructors: h } = require('@jnode/server');
const { routerConstructors: cf } = require('jns-cloudflare');
const server = createServer(
// The CloudflareProxy router verifies if the request comes from Cloudflare
cf.CloudflareProxy(
// Match: The request is from Cloudflare.
// ctx.identity.address is now the real client IP.
r.Path(h.Text('Hello real user!')),
// Fail: The request is NOT from Cloudflare.
// We might want to block direct access or handle it differently.
h.Text('Direct access not allowed', { statusCode: 403 })
)
);
server.listen(8080);
Cloudflare acts as a reverse proxy, meaning your server sees Cloudflare's IP addresses instead of the actual visitor's IP.
jns-cloudflare solves this by:
CF-Connecting-IP header and updates ctx.identity.address.ctx.identity.country and ctx.identity.continent based on Cloudflare's headers.CloudflareProxy(next, fail)next router | handler-extended The next step to execute if the request is confirmed to be routed through Cloudflare.fail router | handler-extended The step to execute if the request remote address does not match Cloudflare's IP ranges.When a request passes through the next path, the following properties are guaranteed/updated in ctx.identity:
address <string>: Updated to the value of the CF-Connecting-IP header.country <string>: Two-letter country code (ISO 3166-1 alpha-2) from CF-IPCountry.continent <string>: Continent code from CF-IPContinent.The router automatically initiates an asynchronous fetch of Cloudflare's IP list upon initialization. If the network request fails, it falls back to a built-in list of known Cloudflare IP ranges to ensure the server remains functional.
FAQs
Cloudflare proxy support for JNS.
The npm package jns-cloudflare receives a total of 1 weekly downloads. As such, jns-cloudflare popularity was classified as not popular.
We found that jns-cloudflare demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.