Summary
HttpMarketplaceRepository.download() accepts any URL from manifest.downloadUrl with no scheme/host validation. Unlike remote theme install (ThemeRemoteInstallPolicy), this allows:
http:// cleartext downloads
- Requests to private/loopback addresses (SSRF when catalog is compromised)
- Non-HTTP schemes if passed through (e.g.
file:// depending on platform)
Default API base is also cleartext: http://localhost:8000/api/v1.
Affected code
lib/core/market/http_marketplace_repository.dart (download(), default baseUrl)
- Consider reusing or extending
ThemeRemoteInstallPolicy patterns
Proposed fix
- Download URLs: HTTPS only; block private/loopback/link-local IPs in release builds (same rules as theme install).
- Allowlist: only permit downloads from trusted hosts (MarketApi CDN domain + configured
baseUrl host).
- API base URL: default to HTTPS; reject cleartext in release (debug may allow localhost).
- Redirect policy: limit redirects; re-validate final URL.
Acceptance criteria
Severity
Medium — SSRF and cleartext MITM when HttpMarketplace is wired to production.
Related
lib/core/theme/theme_remote_install_policy.dart (reference implementation)
- Security review 0.4.11
Summary
HttpMarketplaceRepository.download()accepts any URL frommanifest.downloadUrlwith no scheme/host validation. Unlike remote theme install (ThemeRemoteInstallPolicy), this allows:http://cleartext downloadsfile://depending on platform)Default API base is also cleartext:
http://localhost:8000/api/v1.Affected code
lib/core/market/http_marketplace_repository.dart(download(), defaultbaseUrl)ThemeRemoteInstallPolicypatternsProposed fix
baseUrlhost).Acceptance criteria
download()rejects disallowed schemes and hosts with clear errors.http://,127.0.0.1,169.254.x.x,file://.Severity
Medium — SSRF and cleartext MITM when HttpMarketplace is wired to production.
Related
lib/core/theme/theme_remote_install_policy.dart(reference implementation)