security: RBAC viewer role, identity label length, error sanitization
- RBAC: Viewer role changed from prefix "system." to explicit allowlist of safe read-only methods. Prevents Viewer access to system.factory-reset, system.shutdown, system.reboot, system.disk-cleanup. - identity.create: Name/label param now enforces max 100 chars. - sanitize_error_message: Changed from contains() to starts_with() for prefix matching, preventing internal errors that happen to contain user-facing keywords from leaking through. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
12412c70db
commit
7bbd8f889a
@@ -60,8 +60,11 @@ impl RpcHandler {
|
||||
let name = params
|
||||
.get("name")
|
||||
.and_then(|v| v.as_str())
|
||||
.unwrap_or("Personal")
|
||||
.to_string();
|
||||
.unwrap_or("Personal");
|
||||
if name.len() > 100 {
|
||||
anyhow::bail!("Identity name must be 100 characters or fewer");
|
||||
}
|
||||
let name = name.to_string();
|
||||
|
||||
let purpose_str = params
|
||||
.get("purpose")
|
||||
|
||||
Reference in New Issue
Block a user