You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth): pin the ioBroker TLS certificate on first use
`allowSelfSigned` exists because ioBroker refuses passwords over plain HTTP, so
an authenticated instance is forced onto HTTPS and a home instance signs its own
certificate. But switching off CA validation removed the only proof of who the
server is: the tool would hand the stored password to anything answering on that
address. CodeQL flagged the symptom (js/disabling-certificate-validation on
socket.ts) — SECURITY.md already conceded the cause.
Identity now comes from a pinned SHA-256 fingerprint instead. It is recorded on
the first connection, verified on every one after that, and a change stops the
command *before* anything is sent. Interactively the user is asked; without a
TTY it fails and names `iob-sync trust`. This is what ssh does, including the
residual weakness: the very first connection is still trusted blindly.
Two layers, both needed. `probeCertificate` reads the certificate over a bare
TLS connection without sending an HTTP request, a cookie or a password, which is
what makes it possible to ask the user while the answer still matters. The
pinned https.Agent re-checks on every connection, because an attacker in the
path can relay the probe untouched and interfere only with the connection that
carries the credentials.
`rejectUnauthorized` is no longer assigned a literal `false` anywhere: it is
always `!allowSelfSigned`. The value is the user's decision, not a constant, and
writing it as one both misreports what the code does and is the shape CodeQL
matches on.
`certFingerprint` is optional, so every config written before this keeps
loading.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,7 @@ If `logs` shows nothing, that is usually the adapter's own log level rather than
113
113
|`init`| Write `.iobroker-sync.json`, verify the connection, create the script folder. Asks interactively when run without flags. `--types` also sets up TypeScript definitions. |
114
114
|`types`| Set up editor intellisense (`log`, `schedule`, ...). `--force`, `--offline`. |
115
115
|`login` / `logout`| Save or remove the password for this instance. Never stored in the project. |
116
+
|`trust`| Accept the instance's current TLS certificate. Only needed after it changes. `--yes` skips the prompt. |
116
117
|`pull [pattern]`| Download scripts to disk. Never deletes or overwrites local files. |
0 commit comments