Repository navigation
Make the allowlisted DB host SSRF test independent of DNS - #1547
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The test "allows a blocked host when explicitly allowlisted" in
database.engine.ssrf.spec.tsconnected todb.internal:5432. That really resolves a hostname, so on some runners it waited for DNS and hit the 5 s Jest timeout. It made main CI red once on 2c87b7e (#1542) and passed on every later run.The test now allowlists
127.0.0.1and connects to port 1. Loopback is blocked by default, so the test still proves the allowlist lets a blocked host through. Port 1 is closed, so the driver fails at once with ECONNREFUSED: no DNS and no connect timeout.Changes
database.engine.ssrf.spec.ts: allowlisted hostdb.internalreplaced by127.0.0.1:1.Type
Testing
cd packages/backend && npx jest src/connectors/engines/database.engine.ssrf.spec.ts --maxWorkers=2: 8 passed, 3.2 s.Test-only change. No behaviour change in Cloud or self-hosted.
Checklist
npm test): only this spec was run locally; the full suite runs in CIRelated Issues
Flaky main run on 2c87b7e (#1542).