[grade=pending] QA sprint: commit 103 at-risk files from multi-agent sprint work

Committed by Hermes autonomous QA sprint 2026-08-13.
These files were modified during the Aug 12 sprint but never committed.
This commit is contained in:
Krystie
2026-08-12 17:34:10 -07:00
parent 0bf4406253
commit 503de258b8
105 changed files with 14057 additions and 2632 deletions
+16 -1
View File
@@ -1,6 +1,6 @@
const express = require('express');
const fs = require('fs');
const { TAILSCALE } = require('../src/utilities/constants');
const { TAILSCALE, REGEX } = require('../src/utilities/constants');
const { exists } = require('../src/utilities/fs-helpers');
const { ValidationError, NotFoundError } = require('../src/utilities/errors');
const { ok, successMessage, unauthorized } = require('../src/utils/responses');
@@ -80,6 +80,17 @@ module.exports = function({
router.post('/config', asyncHandler(async (req, res) => {
const { enabled, requireAuth, allowedTailnet } = req.body;
// Validate allowedTailnet is a safe CIDR/domain string if provided
if (typeof allowedTailnet !== 'undefined' && allowedTailnet !== null) {
if (typeof allowedTailnet !== 'string' || allowedTailnet.length > 255) {
throw new ValidationError('allowedTailnet must be a string (max 255 chars)');
}
// Block shell metacharacters and path traversal
if (/[;&|`$()<>\\]/.test(allowedTailnet)) {
throw new ValidationError('allowedTailnet contains invalid characters');
}
}
if (typeof enabled !== 'undefined') tailscale.config.enabled = enabled;
if (typeof requireAuth !== 'undefined') tailscale.config.requireAuth = requireAuth;
if (typeof allowedTailnet !== 'undefined') tailscale.config.allowedTailnet = allowedTailnet;
@@ -150,6 +161,10 @@ module.exports = function({
if (!subdomain) {
throw new ValidationError('subdomain is required');
}
// Validate subdomain before it is interpolated into a regex
if (!REGEX.SUBDOMAIN.test(subdomain)) {
throw new ValidationError('[DC-301] Invalid subdomain format');
}
const content = await caddy.read();
const domain = buildDomain(subdomain);