Credentials can leak via inspect, error messages, and VCR cassettes #2
Labels
No labels
P0
P1
P2
P3
next
project/simplefin-api
ready-for-agent
ready-for-human
review
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/simplefin-api#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Discovered
This gem can expose its credential through three paths. A generator audit of the api-wrapper template found the same pattern here.
Data.defineConfiguration, soinspect,to_h, anddeconstruct_keysprint them; Client and Connection also hold the raw value in an ivar).body, so an echoed credential survives inerr.body. Echo site: lib/simplefin_api/errors.rb:83.Correct fix
Bring the gem onto the fixed api-wrapper tier1 design. Do not make ad-hoc edits.
Secretvalue object for every credential member (api_key, username, password).inspectandto_sreturn[REDACTED]. The raw value is read only at request dispatch.Configuration#inspect,#to_h, and#deconstruct_keysnever expose it.err.bodyis scrubbed of the configured secret.Task checklist
client.inspect,configuration.inspect,to_h, and every error message for stubbed 401/403/404/422/500 bodies that echo it. A stubbed request asserts the raw fake credential reaches the wire.Secretand Configuration coercion.err.body.git log -p -- test/and the cassette dirs) for real credential values. If any are found, rotate the credential and purge or re-record.test_client) and, if the gem defines operations named run/raw/paginate/unwrap/connection/scope, with #77. Resource Base definesunwrap,raw,paginate,run(lib/simplefin_api/resources/base.rb:42,49,65,74).Acceptance criteria
grepof the cassettes finds no credential and no real host.Upstream
Discoverer: /home/jared/dev/cc-plugins, session 37920212-7933-486a-9506-c241c150dd1f, 2026-09-30. Audit of generated gems found credential-leak paths from the api-wrapper template.