dsh-redteam-model
SeaOf0
基于dsh web实现的多种模式,目的是服务于redteam进行授权的安全研究,覆盖渗透测试、红队评估、代码审计等范围领域,请勿用于非法行为。(允许二开,赋予模块各位自己的业务逻辑,方法论只有自己熟练的才好用,好的方法论=好的生态)
yajiangandchenchen/dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix
修复 sandbox_permissions 和 justification 字段在 pwsh/bash/fs/dsh-sandbox 中的 no-op 升级报错。当会话已是 danger-full-access 模式时,模型携带空 justification 或重申同一模式被拒的问题。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:yajiangandchenchen/dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
A DSH plugin that fixes two related bugs in the sandbox_permissions and justification fields across four tools: pwsh, bash, fs (write/edit), and dsh-sandbox.
When a session is already at danger-full-access mode, two errors can occur:
justification: "" (empty string), which triggers validateEscalationArgs to throw invalid justification: expected a non-empty sentence.sandbox_permissions: "danger-full-access" (same as current mode), which triggers approveEscalation to throw sandbox escalation to "X" is not strictly wider.This is the 4th independent report (GitHub #3519 → #4359 → #4383 → #4412) and affects all sessions using non-default models.
Two-layer defense:
dsh plugin add): The plugin is installed and Cordis injects the dynamic plugin line.apply() function in index.js runs patch.js apply, which backs up original files and applies all modifications. This happens automatically on first plugin load.dsh plugin remove): The preuninstall script runs patch.js restore, which restores all original files from backups.dsh plugin --profile web add dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix@latest
Step 1: Restore original files from backups:
cd $env:DSH_HOME\profiles\web\node_modules\dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix
node scripts/patch.js restore
This restores the four tool files (dsh-sandbox, dsh-tool-pwsh, dsh-tool-bash, dsh-tool-fs) to their original state using backups stored in $env:DSH_HOME\backups\dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix\.
Step 2: Remove the plugin:
dsh plugin --profile web remove dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix
How backups work: When the plugin first applies patches, it copies the original files to
DSH_HOME\backups\dsh-sandbox-permissions-not-strictly-wider-justification-empty-fix\(outside the plugin directory). These backups persist even after the plugin is removed, so you can always restore.
| File | Change |
|---|---|
dsh-sandbox/lib/index.js |
approveEscalation: throw → return effectiveMode |
dsh-tool-pwsh/lib/index.js |
import +WIDER_MODES, execute normalization, schema descriptions |
dsh-tool-bash/lib/index.js |
import +WIDER_MODES, execute normalization, schema descriptions |
dsh-tool-fs/lib/index.js |
import +WIDER_MODES, resolvePolicy normalization, schema descriptions |
dsh-std plugin meta protocolMIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: permissions、sandbox。