Commit Graph
9 Commits
Author SHA1 Message Date
AlexKucera b0f8755a56 Enhances security checks and mocks fs module in tests
Updates security check patterns to include brackets for improved command injection prevention. Enhances test reliability by mocking Node's fs module to replace custom mock functions, aligning test behavior closer to actual usage scenarios and ensuring consistent outcomes.

No specific issue reference.
2025-11-09 15:26:33 +01:00
AlexKucera ae5df90eec Rejects absolute paths in vault exports
Updates path normalization to disallow absolute paths, ensuring
exports remain within the vault. Enhances security by rejecting
path traversal attempts.

Aligns with obisidian-bot-review branch requirements.
2025-11-08 19:49:16 +01:00
AlexKucera a71b20e9ba Preserves absolute paths in SecurityUtils
Updates path normalization to maintain absolute paths, aligning
with SettingsTab storage logic. Enhances security by ensuring
consistent path handling and preventing path traversal.

Relates to issue: obsidian-bot-review branch
2025-11-08 19:05:46 +01:00
AlexKucera 2c4076f3c9 Applies Obsidian linter and fixes code issues
Applies linting rules to the codebase and resolves identified issues.

Addresses:
- Renamed headings in settings tabs to improve UI consistency and style.
- Resolved require() style imports
- Added void operator to ensure correct promise handling.
- Replaced deprecated Obsidian API calls.
- Enforces sentence case to enhance UI text consistency.
2025-11-05 13:46:06 +01:00
AlexKucera 207e115699 Restricts shell metacharacters in paths
Addresses a potential command injection vulnerability by tightening the validation of executable paths.

Removes brackets and curly braces from the list of disallowed shell metacharacters in paths on Windows to prevent issues when paths contain these characters. Only the metacharacters that can't appear in safe paths are disallowed.
2025-11-05 08:47:35 +01:00
AlexKucera c788422cdf Strengthens path validation against reserved names
Enhances path validation to prevent issues caused by reserved Windows names.

The previous implementation only checked for reserved names
when the entire path matched a reserved name. This update extends
the check to ensure that no segment of the path, including the
base name without extension, matches a reserved name.

This prevents the use of reserved names, even with extensions or
within directory structures, mitigating potential security risks.
2025-11-05 08:31:44 +01:00
AlexKucera 281c02210a Add Docstrings 2025-11-05 08:03:52 +01:00
Jarvis 9345198337 refactor: clean up ESLint warnings and code quality
- Remove unused imports and variables across multiple files
- Fix prefer-const warnings by changing let to const
- Remove unused catch block variables or convert to parameter-less catch blocks
- Update package-lock.json with TypeScript-ESLint v8 dependencies
- Reduce ESLint warnings from 42 to 22 (remaining are necessary 'any' types)
- All remaining warnings are for Obsidian API compatibility

Fixes improve code quality while maintaining functionality.
Remaining 'any' type warnings are appropriate for Obsidian plugin development.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-10 17:47:17 +02:00
AlexKucera 42aa8e176c Adds output path validation for enhanced security
Enhances security by validating output paths and executable paths.

This prevents path traversal attacks and command injection vulnerabilities
by ensuring that users can only specify valid relative paths within the vault
and safe executable paths. It also displays notices when the path is deemed unsafe.
2025-09-03 22:56:30 +02:00