Update ESLint rules and resolve bot review feedback #8

Merged
AlexKucera merged 24 commits from obsidian-bot-review into master 2025-11-09 12:06:31 +01:00
Showing only changes of commit a71b20e9ba - Show all commits
+8 -5
View File
@@ -116,9 +116,10 @@ export class SecurityUtils {
if (!outputFolder || typeof outputFolder !== 'string') {
return false;
}
// Normalize and resolve the path to detect traversal attempts
const normalizedPath = path.normalize(outputFolder.trim());
// Normalize path, but preserve absolute paths (mirrors SettingsTab storage logic)
const trimmed = outputFolder.trim();
const normalizedPath = path.isAbsolute(trimmed) ? trimmed : path.normalize(trimmed);
// Check for path traversal attempts
if (normalizedPath.includes('..') ||
@@ -280,8 +281,10 @@ export class SecurityUtils {
if (!outputFolder || typeof outputFolder !== 'string') {
return 'Output folder is required';
}
const normalizedPath = path.normalize(outputFolder.trim());
// Normalize path, but preserve absolute paths (mirrors SettingsTab storage logic)
const trimmed = outputFolder.trim();
const normalizedPath = path.isAbsolute(trimmed) ? trimmed : path.normalize(trimmed);
if (normalizedPath.includes('..')) {
return 'Path traversal attempts (..) are not allowed';