mdefender-pro 1.2.5 → 1.2.6
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.
- package/README.md +5 -5
- package/auto.js +1 -1
- package/bin/mdefender.js +1 -1
- package/block-page.html +1 -1
- package/client.mjs +1 -12
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
## Key Features
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
13
|
+
- **Zero Setup Cyber Block Page**: Bundled automatically with the package — no external HTML or static file hosting required.
|
|
14
|
+
- **Sub-Millisecond In-Memory Caching**: Template and rules are cached in memory for instantaneous rendering (<5ms).
|
|
15
|
+
- **Flexible API Key Authentication**: Configure via `mdefender.config.js`, interactive CLI (`npx mdefender-pro init`), environment variables, or inline parameters.
|
|
16
|
+
- **Fail-Open Safety Mechanism**: If cloud telemetry times out, legitimate traffic passes smoothly without blocking customers.
|
|
17
|
+
- **Zero External Runtime Dependencies**: Pure Node.js standard libraries (`http`, `https`, `crypto`).
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
package/auto.js
CHANGED
|
@@ -35,7 +35,7 @@ function autoHook() {
|
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
console.log(`\x1b[36m\x1b[1m
|
|
38
|
+
console.log(`\x1b[36m\x1b[1m[MDefender Pro] Zero-Code WAF Protection Active\x1b[0m`);
|
|
39
39
|
console.log(`\x1b[90m Inspection Endpoint: ${activeConfig.apiEndpoint}\x1b[0m`);
|
|
40
40
|
console.log(`\x1b[90m Protected Domain : ${activeConfig.domain || 'auto-detect'}\x1b[0m`);
|
|
41
41
|
console.log(`\x1b[90m Defense Mode : ${activeConfig.mode.toUpperCase()}\x1b[0m\n`);
|
package/bin/mdefender.js
CHANGED
|
@@ -9,7 +9,7 @@ const args = process.argv.slice(2);
|
|
|
9
9
|
const command = args[0] || 'help';
|
|
10
10
|
|
|
11
11
|
console.log(`\n\x1b[36m\x1b[1m====================================================\x1b[0m`);
|
|
12
|
-
console.log(`\x1b[36m\x1b[1m
|
|
12
|
+
console.log(`\x1b[36m\x1b[1m MDefender Pro — Zero-Code WAF CLI \x1b[0m`);
|
|
13
13
|
console.log(`\x1b[36m\x1b[1m====================================================\x1b[0m\n`);
|
|
14
14
|
|
|
15
15
|
if (command === 'run' || command === 'start') {
|
package/block-page.html
CHANGED
|
@@ -369,7 +369,7 @@
|
|
|
369
369
|
const refBox = document.getElementById('ref-id-box');
|
|
370
370
|
if (refBox) {
|
|
371
371
|
const originalHtml = refBox.innerHTML;
|
|
372
|
-
refBox.innerHTML = 'COPIED TO CLIPBOARD
|
|
372
|
+
refBox.innerHTML = 'COPIED TO CLIPBOARD';
|
|
373
373
|
refBox.style.color = '#10b981';
|
|
374
374
|
refBox.style.borderColor = '#10b981';
|
|
375
375
|
refBox.style.background = '#ecfdf5';
|
package/client.mjs
CHANGED
|
@@ -463,18 +463,7 @@ export function renderOfficialBlockPage(attackType, refId, domain) {
|
|
|
463
463
|
} catch (e) {}
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
//
|
|
467
|
-
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
468
|
-
const rawTarget = normalizeInput(window.location.search + ' ' + window.location.hash);
|
|
469
|
-
if (rawTarget.trim()) {
|
|
470
|
-
for (const pattern of ATTACK_PATTERNS) {
|
|
471
|
-
if (pattern.regex.test(rawTarget)) {
|
|
472
|
-
renderOfficialBlockPage(pattern.type);
|
|
473
|
-
throw new Error(`[MDefender WAF] Attack blocked on load (0ms): ${pattern.type}`);
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
466
|
+
// Client-side initialization requires explicit initWaf() with apiKey
|
|
478
467
|
|
|
479
468
|
/**
|
|
480
469
|
* Initialize MDefender Pro WAF client-side protection for SPAs & Frontend Websites.
|
package/index.js
CHANGED
|
@@ -158,7 +158,7 @@ function sendAnalyzeRequest(endpointUrl, apiKey, data, timeoutMs = 5000) {
|
|
|
158
158
|
'Content-Type': 'application/json',
|
|
159
159
|
'Content-Length': Buffer.byteLength(postData),
|
|
160
160
|
'Authorization': `Bearer ${apiKey}`,
|
|
161
|
-
'X-MDefender-Version': '1.2.
|
|
161
|
+
'X-MDefender-Version': '1.2.6'
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdefender-pro",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "MDefender Pro - Web Application Firewall middleware for Node.js/Express. Protects against XSS, SQLi, CSRF, and other OWASP Top 10 attacks.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|