The v0.1.1 release of docmd-search focuses on security hardening, sanitisation of dynamic file path generation, and secure execution of child processes.
What’s in This Release
Security Hardening
- Secure Child Process Spawning (CWE-78 mitigation):
- Replaced shell-based
execcalls with direct, non-shell execution usingexecFileandexecFileAsyncvia argument arrays when checkinggit status --porcelain. - Replaced shell-based
execSyncwithexecFileSyncwhen discovering the globaldocmdCLI path, ensuring no shell expansion is performed.
- Replaced shell-based
- Dynamic Config Path Sanitisation (CWE-94 mitigation):
- Sanitised directory paths interpolated into the generated web UI configuration (
docmd.config.json) usingJSON.stringifyto prevent breakout vulnerability vectors.
- Sanitised directory paths interpolated into the generated web UI configuration (
- Dynamic Code Evaluation Remediation (CWE-95 mitigation):
- Removed the
new Function('id', 'return import(id)')constructor previously used to import optional peer dependencies dynamically, replacing it with standard ECMA dynamicimport()coupled with build-time annotations.
- Removed the
- Deprecation & Warning Clearance:
- Configured
package.jsonoverrides to forceonnxruntime-node@1.27.0, resolving the transitivebooleanpackage deprecation warnings. - Configured
allowScriptsinpackage.jsonto whitelist required lifecycle binaries (esbuild,onnxruntime-node,protobufjs,sharp) to suppress warnings during installation.
- Configured
Performance Optimisations
- Model Caching: Added a new
keepModelLoadedoption to keep the embedding model loaded in memory, eliminating the model-load overhead on subsequent watch/rebuild runs.
Compatibility
| Surface | Status |
|---|---|
@docmd/plugin-search@>=0.8.14 |
✓ Optional peer. |
@huggingface/transformers@^4.2.0 |
✓ Optional peer, required for the embedding model. |
onnxruntime-node@^1.27.0 |
✓ Optional peer, required for on-device inference. |
| Node.js | >=18 |