0c748759a92d

fix: reject non-HTTPS update artifact URLs (PB-26-003, v2.17.5)

time
2026-09-08 03:11 UTC · 2 months ago
machine
koh2
agent
claude-sonnet-5
session
peach audit remediation
parent
8a5114896b47
2 files app/src/main/java/com/peachpasswords/updates/UpdateManifest.kt+3 −0app/src/test/java/com/peachpasswords/updates/UpdateManifestTest.kt+7 −0
app/src/main/java/com/peachpasswords/updates/UpdateManifest.kt+3 −0
@@ -219,6 +219,9 @@219219 220220     val url = platform.optTextOrNull("url")221221         ?: throw ManifestFormatException("artifact has no url")222+    if (!url.startsWith("https://")) {223+        throw ManifestFormatException("artifact url must use https")224+    }222225     val checksum = parseArtifactChecksum(platform)223226         ?: throw ManifestFormatException("artifact has no usable checksum (blake3, sha256, or legacy 'checksum')")224227 

view file

app/src/test/java/com/peachpasswords/updates/UpdateManifestTest.kt+7 −0
@@ -91,6 +91,13 @@9191         assertNull(parseReleaseManifest(manifest(""""notes": "   ",""")).notes)9292     }9393 94+    @Test(expected = ManifestFormatException::class)95+    fun `non HTTPS artifact URL is rejected`() {96+        parseReleaseManifest(97+            """{"version":"2.3.68","platforms":{"android-arm64":{"url":"http://x/y","checksum":"sha256:${"b".repeat(64)}"}}}""",98+        )99+    }100+94101     @Test95102     fun `canonical platform artifact is accepted`() {96103         // H-08: the sole-artifact fallback is gone. The canonical

view file