Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix: relax port validation to allow Pinchtab instances on any port

Mario2e007817259e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04349ee4..c0040108 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,7 +13,7 @@
- **Integration test stability** — Added retry logic, increased timeouts, and better error reporting for flaky tests (#50)
### Security
-- **SSRF Prevention** — Added port validation to prevent Server-Side Request Forgery in orchestrator health checks. Blocks sensitive ports and validates port range (1024-65535) (#50)
+- **SSRF Prevention** — Added input validation to prevent Server-Side Request Forgery in orchestrator health checks. Validates port format and restricts connections to localhost only (#50)
### Docs
- **Definition of Done** — Added DEFINITION_OF_DONE.md and GitHub PR template with streamlined, actionable checklist (PR #48)
diff --git a/internal/orchestrator/validation.go b/internal/orchestrator/validation.go
index 0d0ff405..5fc009ef 100644
--- a/internal/orchestrator/validation.go
+++ b/internal/orchestrator/validation.go
@@ -18,31 +18,10 @@ func ValidatePort(port string) error {
return fmt.Errorf("invalid port number: %s", port)
}
- // Check valid port range
- if portNum < 1024 || portNum > 65535 {
- return fmt.Errorf("port must be between 1024 and 65535")
- }
-
- // Disallow common sensitive ports
- blockedPorts := []int{
- 3306, // MySQL
- 5432, // PostgreSQL
- 6379, // Redis
- 9200, // Elasticsearch
- 27017, // MongoDB
- 11211, // Memcached
- 2049, // NFS
- 111, // RPC
- 22, // SSH (if somehow in high range)
- 25, // SMTP
- 110, // POP3
- 143, // IMAP
- }
-
- for _, blocked := range blockedPorts {
- if portNum == blocked {
- return fmt.Errorf("port %d is not allowed", portNum)
- }
+ // Check valid port range - allow all valid TCP ports
+ // Pinchtab instances can run on any available port
+ if portNum < 1 || portNum > 65535 {
+ return fmt.Errorf("port must be between 1 and 65535")
}
return nil
diff --git a/internal/orchestrator/validation_test.go b/internal/orchestrator/validation_test.go
index 55852647..c2664f13 100644
--- a/internal/orchestrator/validation_test.go
+++ b/internal/orchestrator/validation_test.go
@@ -12,14 +12,13 @@ func TestValidatePort(t *testing.T) {
}{
{"valid port", "8080", false},
{"valid high port", "65000", false},
+ {"valid pinchtab port", "9867", false},
+ {"mysql port allowed", "3306", false},
+ {"redis port allowed", "6379", false},
{"empty port", "", true},
{"non-numeric", "abc", true},
- {"too low", "80", true},
+ {"too low", "0", true},
{"too high", "70000", true},
- {"mysql port", "3306", true},
- {"redis port", "6379", true},
- {"postgres port", "5432", true},
- {"elasticsearch", "9200", true},
}
for _, tt := range tests {