Introduction¶
In DeepSeek Harness (DSH), webServer routes are dispatched using longest prefix matching and take precedence over the unified trust checks in the /api gateway. This means each plugin author must implement browser trust fences themselves to prevent attacks such as DNS rebinding, but most plugins do not. This tool performs static scans of plugin code to identify HTTP routes whose fences are not implemented correctly.
Core Features¶
This plugin is a static linter for checking the HTTP route security of DSH plugins:
- Static scanning: performs static analysis on routes registered with
webServer. - Host pinning check: Ensures that a route pins the Host header to loopback or a trusted authoritative domain before handling Origin or
sec-fetch-siteflags. - Fallback check: Checks
registerFallbackto prevent it from becoming an unfenced attack surface. - Path specification: Supports scanning specific configuration file paths or Profile directories.
- Reference resolution: Resolves imports and exports, and emits warnings for non-relative references (exports, imports, tsconfig paths).
Usage¶
After installing as a DSH plugin, run the scan through CLI commands.
Basic Scan¶
Scan the default Web Profile directory ($DSH_HOME/profiles/web):
dsh-route-fence scan
Path-Specific Scan¶
Scan a specified Profile path:
dsh-route-fence scan /path/to/profile
Exit Codes¶
0: All checks passed (Clean).1: At least one FAIL was found.2: Usage error or I/O error.
Verdicts¶
The plugin outputs a PASS, WARN, or FAIL verdict for each route.
- PASS: The handler performs a Host header fence check before processing Origin.
- WARN: Inside the fence, Origin or
sec-fetch-siteis read before Host pinning; or the route is defined outside the scanned package, so the fence cannot be read and requires manual confirmation. - FAIL: No Host check; the fence compares Origin and Host but never pins Host to loopback (can be bypassed via DNS rebinding); or the fence exists but the handler is never invoked.
- SKIP: A Bundle whose source code cannot be read; not counted as Clean.
Applicable Scenarios and Notes¶
- Intended audience: DSH plugin developers, especially developers responsible for building HTTP APIs and Web routes.
- Scan scope: Only files published by the package (
filesfield inpackage.json) are scanned; iffilesis not declared, the entire package is scanned. - Limitations:
- Based on heuristics (source text analysis), not full data-flow analysis.
- Cannot check fences installed via wrapping or runtime configuration.
- Non-relative references (such as
package.jsonexports, imports, tsconfig paths) cannot be scanned; the result is WARN. - May report false verdicts, which are considered Bugs.
Conclusion¶
This tool helps developers quickly locate missing or incorrect browser trust fences in plugins. It is recommended to integrate this check into the development workflow to eliminate potential security risks. For more details and source code, visit the plugin catalog or the GitHub repository.