Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@silenteer/natsu-port-server

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@silenteer/natsu-port-server - npm Package Compare versions

Comparing version 0.0.44 to 0.0.45

21

dist/index.js

@@ -214,3 +214,4 @@ "use strict";

let result;
if (!httpRequestSchema.isValidSync({ contentType, subject, traceId })) {
if (!httpRequestSchema.isValidSync({ contentType, subject, traceId }) ||
!validateNatsSubject(subject)) {
result = { code: 400 };

@@ -224,3 +225,4 @@ return result;

let result;
if (!wsRequestSchema.isValidSync(request)) {
if (!wsRequestSchema.isValidSync(request) ||
!validateNatsSubject(request.subject)) {
result = { code: 400 };

@@ -232,2 +234,17 @@ return result;

}
function validateNatsSubject(subject) {
const items = subject.split('.');
for (const item of items) {
// When subject has multis dot side by side as 'a..b', or dot at first/last position as '.a.b.c'
// The dot will become '' after split()
if (!item) {
return false;
}
// Only accept a-z, A-Z, 0-9
if (!/^[\w]*$/.test(item)) {
return false;
}
}
return true;
}
function authenticate(headers) {

@@ -234,0 +251,0 @@ var _a, _b;

2

package.json
{
"name": "@silenteer/natsu-port-server",
"version": "0.0.44",
"version": "0.0.45",
"license": "MIT",

@@ -5,0 +5,0 @@ "private": false,

Sorry, the diff of this file is not supported yet

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