Socket
Socket
Sign inDemoInstall

koa-send

Package Overview
Dependencies
Maintainers
3
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-send - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

10

index.js

@@ -52,6 +52,6 @@

if (-1 == path) return ctx.error('failed to decode', 400);
if (-1 == path) return ctx.throw('failed to decode', 400);
// null byte(s)
if (~path.indexOf('\0')) return ctx.error('null bytes', 400);
if (~path.indexOf('\0')) return ctx.throw('null bytes', 400);

@@ -62,4 +62,4 @@ // index file support

// malicious path
if (!root && !isAbsolute(path)) return ctx.error('relative paths require the .root option', 500);
if (!root && ~path.indexOf('..')) return ctx.error('malicious path', 400);
if (!root && !isAbsolute(path)) return ctx.throw('relative paths require the .root option', 500);
if (!root && ~path.indexOf('..')) return ctx.throw('malicious path', 400);

@@ -70,3 +70,3 @@ // relative to root

// out of bounds
if (root && 0 != path.indexOf(root)) return ctx.error('malicious path', 400);
if (root && 0 != path.indexOf(root)) return ctx.throw('malicious path', 400);

@@ -73,0 +73,0 @@ // hidden file support, ignore

@@ -5,3 +5,3 @@ {

"repository": "koajs/send",
"version": "1.1.1",
"version": "1.1.2",
"keywords": [

@@ -8,0 +8,0 @@ "koa",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc