@ornexus/neocortex-cli 4.5.2 → 4.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +1 -1
  2. package/install.js +28 -7
  3. package/package.json +3 -1
package/LICENSE CHANGED
@@ -5,7 +5,7 @@ Copyright (c) 2026 OrNexus AI
5
5
  Parameters
6
6
 
7
7
  Licensor: OrNexus AI
8
- Licensed Work: Synapse CLI
8
+ Licensed Work: Neocortex CLI
9
9
  The Licensed Work is (c) 2026 OrNexus AI.
10
10
  Additional Use Grant: You may make production use of the Licensed Work,
11
11
  provided such use does not include offering the
package/install.js CHANGED
@@ -10,7 +10,6 @@
10
10
  */
11
11
 
12
12
  const https = require('https');
13
- const http = require('http');
14
13
  const fs = require('fs');
15
14
  const path = require('path');
16
15
  const os = require('os');
@@ -71,9 +70,17 @@ function getPlatformInfo() {
71
70
  // HTTP HELPERS
72
71
  // ═══════════════════════════════════════════════════════════════════
73
72
 
74
- function fetch(url, options = {}) {
73
+ function fetch(url, options = {}, _redirectCount = 0) {
75
74
  return new Promise((resolve, reject) => {
76
- const protocol = url.startsWith('https') ? https : http;
75
+ if (_redirectCount > 5) {
76
+ return reject(new Error('Too many redirects (max 5)'));
77
+ }
78
+
79
+ const parsedUrl = new URL(url);
80
+ if (parsedUrl.protocol !== 'https:') {
81
+ return reject(new Error(`Insecure protocol blocked: ${parsedUrl.protocol} - only HTTPS is allowed`));
82
+ }
83
+
77
84
  const headers = {
78
85
  'User-Agent': `neocortex-cli/${VERSION}`,
79
86
  'Accept': options.accept || 'application/json',
@@ -83,10 +90,19 @@ function fetch(url, options = {}) {
83
90
  if (GITHUB_TOKEN && url.includes('github.com')) {
84
91
  headers['Authorization'] = `Bearer ${GITHUB_TOKEN}`;
85
92
  }
86
- const req = protocol.get(url, { headers }, (res) => {
87
- // Follow redirects
93
+ const req = https.get(url, { headers }, (res) => {
94
+ // Follow redirects (with limit and HTTPS validation)
88
95
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
89
- return fetch(res.headers.location, options).then(resolve).catch(reject);
96
+ const redirectUrl = res.headers.location;
97
+ try {
98
+ const redirectParsed = new URL(redirectUrl);
99
+ if (redirectParsed.protocol !== 'https:') {
100
+ return reject(new Error(`Redirect to insecure protocol blocked: ${redirectParsed.protocol}`));
101
+ }
102
+ } catch {
103
+ return reject(new Error(`Invalid redirect URL: ${redirectUrl}`));
104
+ }
105
+ return fetch(redirectUrl, options, _redirectCount + 1).then(resolve).catch(reject);
90
106
  }
91
107
 
92
108
  if (res.statusCode !== 200) {
@@ -248,7 +264,12 @@ async function install() {
248
264
  process.exit(1);
249
265
  }
250
266
  } else {
251
- console.log(' (no checksum available, skipped)');
267
+ console.log(' FAILED');
268
+ fs.unlinkSync(tmpPath);
269
+ console.error('\n ERRO: SHA256SUMS.txt nao encontrado na release.');
270
+ console.error(' Checksum verification is MANDATORY for security.');
271
+ console.error(` Baixe manualmente: https://github.com/${REPO}/releases\n`);
272
+ process.exit(1);
252
273
  }
253
274
 
254
275
  // Atomic move
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ornexus/neocortex-cli",
3
- "version": "4.5.2",
3
+ "version": "4.6.2",
4
4
  "description": "Neocortex CLI - AI Agent Orchestrator for multi-platform development (Claude Code, Cursor, VS Code, Gemini, Codex)",
5
5
  "keywords": [
6
6
  "claude",
@@ -108,6 +108,8 @@
108
108
  },
109
109
  "devDependencies": {
110
110
  "@vitest/coverage-v8": "^3.2.4",
111
+ "audit-ci": "^7.1.0",
112
+ "javascript-obfuscator": "^4.1.1",
111
113
  "react-devtools-core": "7.0.1",
112
114
  "vitest": "^3.2.4"
113
115
  }