1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
.{
.{
.name = "finding: generated TIDs above 6 << 50 are rejected",
.file = "src/internal/syntax/tid.zig",
.old = "if (high > std.math.maxInt(u3)) return null;",
.new = "if (high > 5) return null;",
},
.{
.name = "finding: DPoP nonce loses JSON special characters",
.file = "src/internal/oauth/primitives.zig",
.old = "try aw.writer.print(\",\\\"nonce\\\":{f}\", .{std.json.fmt(n, .{})});",
.new = "try aw.writer.print(\",\\\"nonce\\\":\\\"{s}\\\"\", .{n});",
},
.{
.name = "finding: firehose CAR is not rooted at the commit CID",
.file = "src/internal/streaming/firehose.zig",
.old = "if (commit.commit) |commit_cid| try root_cids.append(allocator, commit_cid);",
.new = "",
},
.{
.name = "finding: Retry-After HTTP-date is ignored",
.file = "src/internal/xrpc/xrpc.zig",
.old = "if (self.millisUntil(at, now)) |milliseconds| return milliseconds;",
.new = "_ = at;",
},
.{
.name = "Retry-After delta seconds is ignored",
.file = "src/internal/xrpc/xrpc.zig",
.old = "if (headers.retry_after) |seconds| {",
.new = "if (@as(?u64, null)) |seconds| {",
},
.{
.name = "exponential backoff starts one doubling late",
.file = "src/internal/xrpc/xrpc.zig",
.old = "const shift: u6 = @intCast(@min(attempt, 16));",
.new = "const shift: u6 = @intCast(@min(@as(u16, attempt) + 1, 16));",
},
.{
.name = "a POST is retried after a 5xx",
.file = "src/internal/xrpc/xrpc.zig",
.old = "if (method == .POST and status != .too_many_requests) return false;",
.new = "if (method == .PUT and status != .too_many_requests) return false;",
},
.{
.name = "one retry past max_attempts",
.file = "src/internal/xrpc/xrpc.zig",
.old = "if (attempt + 1 < attempts and retry_policy.isRetryableStatusForMethod(",
.new = "if (attempt < attempts and retry_policy.isRetryableStatusForMethod(",
},
.{
.name = "transport errors retried with retry_transient_errors off",
.file = "src/internal/xrpc/xrpc.zig",
.old = "if (attempt + 1 >= attempts or !retry_policy.retry_transient_errors or !isRetryableTransportErrorForMethod(method, err)) {",
.new = "if (attempt + 1 >= attempts or !isRetryableTransportErrorForMethod(method, err)) {",
},
.{
.name = "query values keep spaces unescaped",
.file = "src/internal/xrpc/xrpc.zig",
.old = "if (std.ascii.isAlphanumeric(c) or c == '-' or c == '_' or c == '.' or c == '~') {",
.new = "if (std.ascii.isAlphanumeric(c) or c == '-' or c == '_' or c == '.' or c == '~' or c == ' ') {",
},
.{
.name = "a procedure drops the bearer token",
.file = "src/internal/xrpc/xrpc.zig",
.old = ".authorization = auth_value,",
.new = ".authorization = if (method == .GET) auth_value else null,",
},
.{
.name = "finding: a DID document for another DID is accepted",
.file = "src/internal/identity/did_resolver.zig",
.old = "if (!std.mem.eql(u8, doc.id, did.raw)) return error.DidDocumentIdMismatch;",
.new = "_ = did;",
},
.{
.name = "finding: a non-literal A answer becomes the dial host",
.file = "src/internal/identity/network_safety.zig",
.old = "_ = std.Io.net.Ip4Address.parse(data, 0) catch return error.IdentityDnsResolutionFailed;",
.new = "",
},
.{
.name = "finding: 3fff::/20 passes as routable",
.file = "src/internal/identity/network_safety.zig",
.old = "if (matchesIp6(ip, .{ 0x3f, 0xff } ++ @as([14]u8, @splat(0)), 20)) return true;",
.new = "",
},
.{
.name = "link-local IPv4 passes as routable",
.file = "src/internal/identity/network_safety.zig",
.old = ".{ .network = .{ 169, 254, 0, 0 }, .prefix = 16 },",
.new = "",
},
.{
.name = "a second did= TXT record is ignored",
.file = "src/internal/identity/handle_resolver.zig",
.old = "if (found_count != 1) {",
.new = "if (found_count == 0) {",
},
.{
.name = "a nonce retry signs with the nonce it was challenged on",
.file = "src/internal/oauth/client.zig",
.old = " nonce = retry_nonce;",
.new = " nonce = if (retry_nonce != null) params.dpop_nonce else null;",
},
.{
.name = "a resource proof omits ath",
.file = "src/internal/oauth/client.zig",
.old = " .access_token_hash = ath,",
.new = " .access_token_hash = null,",
},
.{
.name = "a block reader error leaves the stub marked dirty",
.file = "src/internal/repo/mst.zig",
.old = " const block_data = (try reader.get(cid.raw)) orelse return error.PartialTree;",
.new = " const block_data = (reader.get(cid.raw) catch |err| {\n node.dirty = true;\n return err;\n }) orelse return error.PartialTree;",
},
.{
.name = "every DPoP proof carries the same jti",
.file = "src/internal/oauth/primitives.zig",
.old = ", .{ jti, std.json.fmt(htm, .{}), std.json.fmt(htu, .{}), now });",
.new = ", .{ \"fixed\", std.json.fmt(htm, .{}), std.json.fmt(htu, .{}), now });",
},
.{
.name = "did:web fetch drops the preflight's pinned address",
.file = "src/internal/identity/did_resolver.zig",
.old = "return try self.fetchDidDocument(did, url, checked_url.resolvedConnection());",
.new = "return try self.fetchDidDocument(did, url, null);",
},
}