Skip to content

Commit 33eb2a4

Browse files
authored
feat!: invert ssl_verify_certificate default from false to true (#44)
BREAKING CHANGE: the default of `ssl_verify_certificate` is flipped from `false` to `true`. This is the v2.0.0 cut the audit (PROPOSAL.md §3.1 #1, MP-1) called for, after a long discussion of the trade-off: the old default made MITM trivial, the new default breaks every existing user that connected to a self-signed or direct-IP server. The change is one line in action.yml plus a matching default in the FTP_SETTINGS block of init.sh (the latter only matters when the action is run outside the GitHub Actions defaulting mechanism, e.g. for local smoke tests). The README's 'Security and SSL' section is rewritten to document the new default and the explicit opt-out path. The CHANGELOG gets a new `## [2.0.0] - TBD` section that calls out the breaking change and the compat-preserving nature of the v1.4 / v1.5 work that preceded it. Migration for existing users: ```yaml - uses: airvzxf/ftp-deployment-action@v1 # still on the old default - uses: airvzxf/ftp-deployment-action@v2 # will fail on self-signed with: server: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} ssl_verify_certificate: 'false' # opt back into v1.x behaviour ``` Validation: * shellcheck, actionlint, hadolint (error threshold), contract test and smoke test all green — the change is a one-line default flip, no other code paths are affected. * Verified the new default reaches lftp by inspecting `FTP_SETTINGS` in the smoke-test output: it now contains `set ssl:verify-certificate true;` when no input override is provided. Recommended next steps for the maintainer (out of scope for this PR): * Tag this commit as v2.0.0 after merge. * Cut a v1.3.4 release off master ~at v1.3.3 (no behaviour change) for users who want to pin to the last v1.x line and never see this default flip. * Add a `v1` major-version ref pointing at the v1.3.x series so `@v1` resolves to the last v1.x release.
1 parent 46167c9 commit 33eb2a4

4 files changed

Lines changed: 31 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.0.0] - TBD
9+
10+
### Breaking
11+
12+
- `ssl_verify_certificate` default changed from `"false"` to `"true"`.
13+
This is a behaviour change for every existing v1.x user that relied
14+
on the lax default to connect to a self-signed or direct-IP
15+
server. With v2.0.0, the action refuses to connect to a server
16+
with an invalid, expired, or hostname-mismatched certificate.
17+
To opt back into the v1.x behaviour, set
18+
`ssl_verify_certificate: "false"` explicitly in your workflow.
19+
20+
This is the breaking change promised in the original audit
21+
(PROPOSAL.md §3.1 #1 and the MP-1 entry). All other v1.x→v2.0.0
22+
changes are behaviour-preserving (the security hardening and
23+
validation work in v1.4.0 and v1.5.0 is compatible with the
24+
v1.x contract).
25+
26+
### Changed
27+
28+
- README: the "Security and SSL" section now documents the new
29+
default and the opt-out path; the warning is no longer about a
30+
known-insecure default but about the rare case of a user
31+
explicitly opting back into the v1.x lax behaviour.
32+
833
## [Unreleased]
934

1035
### Added
@@ -81,5 +106,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
81106

82107
Historical. See git history for changes prior to `CHANGELOG.md` adoption.
83108

84-
[Unreleased]: https://github.com/airvzxf/ftp-deployment-action/compare/v1.3.3...HEAD
109+
[Unreleased]: https://github.com/airvzxf/ftp-deployment-action/compare/v2.0.0...HEAD
110+
[2.0.0]: https://github.com/airvzxf/ftp-deployment-action/compare/v1.3.3...v2.0.0
85111
[1.3.3]: https://github.com/airvzxf/ftp-deployment-action/releases/tag/v1.3.3

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ This GitHub action copies the files via FTP from your Git project to your server
44

55
## Security and SSL
66

7-
By default, `ftp_ssl_allow` is set to `true` to ensure your connection is encrypted. However, `ssl_verify_certificate` is set to `false` by default. This means your data is encrypted during transfer, but the Action does not verify if the server's certificate is valid or matches the hostname. This prevents connection errors with self-signed certificates or direct IP connections but leaves you vulnerable to Man-in-the-Middle (MITM) attacks if someone spoofs your DNS.
7+
By default, `ftp_ssl_allow` is set to `true` to ensure your connection is encrypted, and `ssl_verify_certificate` is also set to `true`, so the action refuses to connect to a server with an invalid, expired, or hostname-mismatched certificate. **This is a breaking change from v1.x**: if you connect to a server with a self-signed certificate or a direct IP, the action will now fail with a TLS error. To opt back into the v1.x behaviour, set `ssl_verify_certificate: false` explicitly in your workflow.
88

9-
If you require strict security, set `ssl_verify_certificate: true` and ensure your server has a valid certificate matching the hostname used.
9+
> **Note on direct-IP connections**: lftp cannot validate a hostname against an IP-address certificate, so `ssl_verify_certificate: true` requires both a valid certificate and a hostname (not a bare IP) in the `server` input.
1010
1111
## Usage Example
1212

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ inputs:
4444
ssl_verify_certificate:
4545
description: 'Verify SSL certificate.'
4646
required: false
47-
default: 'false'
47+
default: 'true'
4848
ssl_check_hostname:
4949
description: 'Check certificate hostname.'
5050
required: false

init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ fi
189189
if [ -n "${INPUT_SSL_VERIFY_CERTIFICATE}" ]; then
190190
FTP_SETTINGS="${FTP_SETTINGS}set ssl:verify-certificate ${INPUT_SSL_VERIFY_CERTIFICATE};"
191191
else
192-
FTP_SETTINGS="${FTP_SETTINGS}set ssl:verify-certificate false;"
192+
FTP_SETTINGS="${FTP_SETTINGS}set ssl:verify-certificate true;"
193193
fi
194194

195195
# ssl:check-hostname

0 commit comments

Comments
 (0)