A PostgreSQL password file named .pgpass is attached from a mention

Open Beginner friendly
#2,148 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
postgresql, rust
Domain
backend, security

Research direction

Read credential_path in crates/formless-core/src/daemon.rs and builtin in crates/formless-runtime/src/sensitive_paths.rs; compare how both handle .netrc. Add the two named PostgreSQL password-file basenames to both checks. Done when mentions of either file are rejected and an MCP root pointing to one is refused; the issue names no tests.

Written by the indexing model from the issue text.

Description

What is wrong

A PostgreSQL password file is attached from an @ mention. Neither credential check knows the name.

@~/.pgpass and @~/pgpass.conf (the Windows file %APPDATA%\postgresql\pgpass.conf) both pass. The file is ordinary text, so it is inlined into the prompt. Each line is hostname:port:database:username:password.

.netrc is refused. .pgpass is the same kind of file and is not on either list. A copy that lives outside ~ is also attached, because the check is by basename and directory, not by “only in the home directory.”

Where

  • crates/formless-core/src/daemon.rs, credential_path. The filename list includes .netrc, .npmrc, .pypirc, and .git-credentials. It does not include .pgpass or pgpass.conf. The directory list (.ssh, .aws, …) does not cover a file that sits directly in the home directory or in postgresql\.
  • crates/formless-runtime/src/sensitive_paths.rs, builtin. The credential-store names include .netrc and _netrc, not .pgpass or pgpass.conf.
  • Mentions call both. daemon.rs AttachPath returns only when credential_path is Some, then when policy.classify is not Ordinary. MCP filesystem exposure uses credential_path too (mcp_catalog.rs).

credential_path lowercases the filename, and builtin does the same, so the gap is the missing names, not case.

Why it matters

~/.pgpass exists so clients can log in without a prompt. Mentioning it sends every saved database password to the model. The guard already exists for .netrc so that kind of file is never attached from a mention.

This is not #2142 (id_ed25519.pub is refused because the private-key prefix also matches the .pub name). This is not #2058 (.env.example refused). This is not #863, which added the mention guard these lists belong to.

Suggested fix

Treat the basenames .pgpass and pgpass.conf like .netrc in both credential_path and sensitive_paths::builtin. @~/.pgpass and @~/AppData/Roaming/postgresql/pgpass.conf should fail the mention with the credential error, and an MCP root that is that file should be refused the same way.

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.