fix: resolve CodeQL security alerts (v0.11.10 Beta)
Log injection (3 errors fixed): - errorHandler.ts: sanitize req.path before logging (strip \r\n) - clients.ts: sanitize mac param in two Flux error log lines Dismissed as false positives or won't-fix with justifications: - Insecure Helmet config: CSP intentionally disabled (self-hosted, Vite/React inline styles require complex allowlist) - Permissive CORS: wildcard only active when admin explicitly sets CORS_ORIGIN=*, documented as unsafe - Network data to file (cert.ts x2): intentional cert upload feature - File system race (oui.ts): trusted startup URL, no attack surface - Insecure temp file (oui.ts): server-side OUI DB, not user-accessible - Remote property injection (DeviceCollector.ts): data from trusted RouterOS API on admin-credentialed device, not user HTTP input - Rate limiting (19): all routes behind JWT; login already rate-limited Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3eb85087f2
commit
fc27f2a4a2
@@ -2,7 +2,7 @@
|
||||
|
||||
A self-hosted, full-stack network management platform for MikroTik devices. Monitor, configure, and manage your entire MikroTik infrastructure — routers, switches, and wireless access points — from a single web interface.
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mikrotik-manager-backend",
|
||||
"version": "0.11.9-beta",
|
||||
"version": "0.11.10-beta",
|
||||
"description": "Mikrotik Network Management Platform - Backend API",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -6,7 +6,7 @@ export function errorHandler(
|
||||
res: Response,
|
||||
_next: NextFunction
|
||||
): void {
|
||||
console.error(`[${req.method} ${req.path}]`, err.message);
|
||||
console.error(`[${req.method} ${req.path.replace(/[\r\n]/g, '_')}]`, err.message);
|
||||
|
||||
if (res.headersSent) return;
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ router.get('/:mac/traffic', async (req: Request, res: Response) => {
|
||||
if (time && field && value != null) raw.push({ time, field, value });
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(`[clients/traffic] Flux error for ${mac}:`, err);
|
||||
console.error(`[clients/traffic] Flux error for ${mac.replace(/[\r\n]/g, '_')}:`, err);
|
||||
}
|
||||
|
||||
// Separate tx and rx series, sort by time, then compute non-negative deltas
|
||||
@@ -242,7 +242,7 @@ router.get('/:mac/signal', async (req: Request, res: Response) => {
|
||||
if (time && value != null) points.push({ time, signal_strength: Math.round(value) });
|
||||
});
|
||||
} catch (err) {
|
||||
console.error(`[clients/signal] Flux error for ${mac}:`, err);
|
||||
console.error(`[clients/signal] Flux error for ${mac.replace(/[\r\n]/g, '_')}:`, err);
|
||||
}
|
||||
|
||||
return res.json(points);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mikrotik-manager-frontend",
|
||||
"version": "0.11.9-beta",
|
||||
"version": "0.11.10-beta",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1 +1 @@
|
||||
export const APP_VERSION = 'v0.11.9 Beta';
|
||||
export const APP_VERSION = 'v0.11.10 Beta';
|
||||
|
||||
Reference in New Issue
Block a user