fix(security): enforce sk-* UP and UV flags once russh exposes the signature
维护者通常 1 天内回复
@inureyes 已经在做这个了。
开始于 2026年11月5日。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- rust
调研方向
Read docs/UPSTREAM_PR_RUSSH.md and inspect russh’s server/encrypted.rs and src/server/handler.rs to understand the signature handoff; the upstream API change and release are prerequisites. Then trace src/server/auth/publickey.rs and the security key signature code, starting with tests that encode signatures. Done means the real auth flow enforces UP and UV as specified, tests cover both key types and flag failures, and the two security docs are updated.
由索引模型根据 Issue 内容生成。
描述
Depends on #338.
Problem
After #338, bssh-server accepts an [email protected] or [email protected] user key only when its authorized_keys line has no-touch-required and lacks verify-required, because bssh cannot read the signature's flags byte. OpenSSH accepts the other lines too, enforcing user presence (UP, flag 0x01) unless no-touch-required is set and user verification (UV, flag 0x04) when verify-required is set.
Current Behavior
- russh 0.64.1
server/encrypted.rs:1060-1074runsVerifier::verify, then callshandler.auth_publickey(user, key)with the key only, sosrc/server/handler.rs:349never sees the signature. - ssh-key's sk verifiers (
signature.rs:456-490) authenticateSHA256(app) || flags || counter || SHA256(msg)but do not test the flags. The flags byte is the 5th-to-last byte of the decoded signature (flags || u32 countertrailer).
Proposed Solution
- Propose an upstream russh change that passes the verified
Signature(or its sk flags) to the server handler, for example aHandlermethod called after verification with(user, key, signature)whose default delegates toauth_publickey. Record the proposal indocs/UPSTREAM_PR_RUSSH.md. - Once a russh release contains it, bump
russhinCargo.toml. - In
src/server/auth/publickey.rs, for sk keys requireflags & 0x01unless the matching line hasno-touch-required, andflags & 0x04when it hasverify-required. Replace #338's fail-closed rejection with this check.
Acceptance Criteria
- Upstream proposal filed and recorded in
docs/UPSTREAM_PR_RUSSH.md; russh bumped to a release containing it. - UP required by default and relaxed only by
no-touch-required. - UV required when
verify-requiredis set. - Enforced in the real
auth_publickeyflow;docs/security.mdanddocs/openssh-compatibility-status.mdupdated. - Tests sign with
encode_signature(src/ssh/security_key/signature.rs) or fixed vectors, cover both key types, and each fails when its flag check is removed.
Verification
cargo test server::auth
cargo clippy --all-targets -- -D warnings
- 主要语言
- Rust
- 星标
- 71
- 派生
- 7
- 平均合并
- 4 小时 51 分钟
- 30 天内合并 PR
- 14
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lablup/bssh 的其他 Issue
-
feat(ssh): add webauthn-sk host-key support可能已有人在做 @inureyes 于 24 天前认领。 未关闭priority:low status:blocked type:enhancement
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
fix(security): verify the server host key presented on re-key可能已有人在做 @inureyes 于 24 天前认领。 未关闭priority:low status:blocked type:security
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
feat(agent): bind destination-constrained agent keys with [email protected]可能已有人在做 @inureyes 于 24 天前认领。 未关闭priority:medium status:blocked type:enhancement
难度 5/5 一周以上 新手友好度 25/100
维护者通常 1 天内回复
-
perf(sftp): adopt the russh-sftp borrowed write API in upload dispatch可能已有人在做 @inureyes 于 24 天前认领。 未关闭priority:medium status:backlog type:performance
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
feat: Implement real-time streaming output with interactive multi-node UI可能已有人在做 @inureyes 于 396 天前认领。 未关闭priority:medium status:backlog type:enhancement
维护者通常 1 天内回复
相似的 Issue
-
area:ui effort:medium enhancement P7 source:agent
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
marketing
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
documentation priority: low tech-debt
难度 2/5 1-3 小时 新手友好度 64/100
nledford/Ladderback#1823 ·
维护者通常 1 天内回复
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)可能已有人在做 @ealwanlee 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
psmux/psmux-plugins#47 ·
-
bug
难度 2/5 1-3 小时 新手友好度 87/100
维护者通常 1 天内回复