A private key named id_dsa is attached from a mention

Open Beginner friendly
#2,149 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
devtools, security

Research direction

Start with credential_path in crates/formless-core/src/daemon.rs and the attachment coverage in crates/formless-core/tests/attachments.rs; also read builtin in crates/formless-runtime/src/sensitive_paths.rs to understand the second mention check. Add coverage showing that id_dsa is refused both under and outside .ssh, while id_dsa.pub remains attachable. Done when the private key is blocked and the public key behavior is preserved.

Written by the indexing model from the issue text.

Description

What is wrong

An OpenSSH DSA private key is attached from an @ mention. The filename check knows the other default private-key names and not this one.

@keys/id_dsa passes. The file is ordinary text, so it is inlined into the prompt. The same path with id_rsa, id_ecdsa, or id_ed25519 is refused as a credential. ID_DSA is the same miss, because the name is lowercased before the prefix check and id_dsa is not one of the prefixes.

A copy that lives outside ~/.ssh is also attached. The directory rule only fires for a component named .ssh. sensitive_paths does not look at id_* names either, so the second mention check classifies keys/id_dsa as ordinary. id_rsa is already blocked by the filename list alone; id_dsa is not on that list.

id_dsa.pub stays attachable. That is the public half, and it should stay attachable (#2142).

Where

  • crates/formless-core/src/daemon.rs, credential_path. After the credential-directory walk, the lowercased filename is matched with starts_with("id_rsa"), starts_with("id_ed25519"), and starts_with("id_ecdsa"). There is no id_dsa arm.
  • attach_path returns only when credential_path is Some, then when policy.classify is not Ordinary. crates/formless-runtime/src/sensitive_paths.rs builtin does not name id_dsa, so a file outside .ssh is Ordinary there.
  • mentions_never_take_credentials_or_leave_the_folder in crates/formless-core/tests/attachments.rs plants .ssh/id_rsa and .env. It never checks id_dsa outside .ssh.

MCP filesystem exposure uses credential_path too (mcp_catalog.rs). A root that is the file id_dsa is not reported as a credential path.

Why it matters

id_dsa is the private key ssh-keygen -t dsa writes. Mentioning a copy that sits next to a project sends that key to the model. The guard already exists so id_rsa is never attached from a mention. DSA is the same kind of file.

This is not #2142. That issue is id_ed25519.pub (and the .pub names of the prefixes already listed) being refused. id_dsa.pub is not refused today. This is not #2148 (.pgpass). This is not #863, which added the mention guard this list belongs to.

Suggested fix

Treat a lowercased basename that starts with id_dsa like id_rsa, except a name that ends in .pub. @keys/id_dsa should fail the mention with the credential error. @keys/id_dsa.pub should still attach. Keep refusing id_rsa and anything under .ssh.

Dominant language
Rust
Stars
0
Forks
0
Avg merge
12h 10m
Merged PRs (30d)
780

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from athiwatc/formless

All issues in athiwatc/formless

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.