clj-commons / clj-commons/clj-ssh

Consider redact password included in jump-connect exception

Open
#65 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
241
Forks
66
PR merge metrics
No merged PRs in 30d

Description

If an error occurs during connection, the [exception thrown](https://github.com/clj-commons/clj-ssh/blob/7b075dbc46d010cfe42e85be988f69f069db94e7/src/clj_ssh/ssh.clj#L445-L446) includes the entire `hosts` list, which in turn may have passwords and those passwords will be present in the stacktrace.

```clojure
(fn [e s]
(throw
(ex-info
(str "Failed to connect "
(.getUserName s) "@"
(.getHost s) ":"
(.getPort s)
" " (pr-str (into [] (.getIdentityNames agent)))
" " (pr-str hosts))
{:hosts hosts}
e)))
```

The password could be removed from the exception message and data.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/clj_ssh/ssh.clj at lines 445-446 and inspect how the jump-connect exception uses hosts in its message and data. Done means the exception no longer exposes passwords in either the stacktrace message or exception data while retaining useful connection information.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.