Skip to content

Commit de2c5ef

Browse files
committed
Merge remote-tracking branch 'origin/v0.39.x-celestia' into wt-2949b
# Conflicts: # consensus/byzantine_test.go
2 parents 5ddcae2 + 2e3e8c7 commit de2c5ef

33 files changed

Lines changed: 805 additions & 45 deletions
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Strip BlobTx wrappers in `ExecCommitBlock` to match `applyBlock` behavior,
2+
fixing a crash recovery replay determinism issue where different transaction
3+
bytes were sent to `FinalizeBlock` during replay vs normal execution.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- `[blocksync]` Cross-validate ExtendedCommit against LastCommit before
2+
persisting during block sync to prevent a malicious peer from injecting a
3+
corrupted ExtendedCommit that causes a panic on consensus restart.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- `[evidence]` Add PubKey-to-Address binding check in
2+
`validateABCIEvidence` to prevent LightClientAttackEvidence with swapped
3+
PubKeys from redirecting slash attribution to innocent validators.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- `[types]` Validate that `LightClientAttackEvidence.ConflictingBlock.SignedHeader`
2+
is non-nil in `ValidateBasic` to prevent a nil pointer panic during block
3+
deserialization. Backported from cometbft/cometbft#5757.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Enforce `maxRequestsPerPeer` on the direct SeenTx→requestTx path in the
2+
CAT mempool reactor. Previously, a peer could bypass the 30-request per-peer
3+
cap by sending SeenTx messages without signer/sequence information.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- Cap `SeenTxSet` to 10,000,000 entries (~5 GB worst-case) to prevent
2+
unbounded memory growth from malicious peers flooding SeenTx messages
3+
with random tx keys.
4+
([\#CELESTIA-256](https://github.com/celestiaorg/celestia-core/issues/CELESTIA-256))
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- `[abci/client]` Add missing `QuerySequence` case to `resMatchesReq` in socket
2+
client, which caused the client to treat a valid `QuerySequence` response as
3+
unexpected and terminate the connection.

.github/CODEOWNERS

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# CODEOWNERS: https://help.github.com/articles/about-codeowners/
1+
# CODEOWNERS: <https://help.github.com/articles/about-codeowners/>
22

3-
# Everything goes through the following "global owners" by default.
4-
# Unless a later match takes precedence, these three will be
5-
# requested for review when someone opens a PR.
6-
# Note that the last matching pattern takes precedence, so
7-
# global owners are only requested if there isn't a more specific
8-
# codeowner specified below. For this reason, the global codeowners
9-
# are often repeated in package-level definitions.
10-
* @rach-id @evan-forbes @mcrakhman @ninabarbakadze
3+
# Everything goes through the protocol team by default. The team's review
4+
# assignment settings control how many reviewers are auto-assigned per PR.
5+
# See: https://github.com/orgs/celestiaorg/teams/protocol/edit/review_assignment
6+
7+
# global owners
8+
* @celestiaorg/protocol

abci/client/socket_client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ func resMatchesReq(req *types.Request, res *types.Response) (ok bool) {
504504
_, ok = res.Value.(*types.Response_ProcessProposal)
505505
case *types.Request_FinalizeBlock:
506506
_, ok = res.Value.(*types.Response_FinalizeBlock)
507+
case *types.Request_QuerySequence:
508+
_, ok = res.Value.(*types.Response_QuerySequence)
507509
}
508510
return ok
509511
}

abci/client/socket_client_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,34 @@ func TestCallbackInvokedWhenSetLate(t *testing.T) {
195195
require.True(t, called)
196196
}
197197

198+
// TestQuerySequenceCrashesSocketClient reproduces a vulnerability where calling
199+
// QuerySequence over the socket ABCI transport causes the client to stop with
200+
// an error because resMatchesReq is missing the QuerySequence case. When this
201+
// happens in production, killTMOnClientError terminates the entire node.
202+
// A remote peer can trigger this by sending a SeenTx message with a non-empty
203+
// Signer field, which causes the CAT mempool reactor to call QuerySequence
204+
// before validating the message fields.
205+
func TestQuerySequenceCrashesSocketClient(t *testing.T) {
206+
ctx, cancel := context.WithCancel(context.Background())
207+
defer cancel()
208+
209+
app := types.BaseApplication{}
210+
_, c := setupClientServer(t, app)
211+
212+
// Call QuerySequence over the socket transport. If the bug is present,
213+
// the socket client will stop itself because resMatchesReq returns false
214+
// for Request_QuerySequence <-> Response_QuerySequence.
215+
resp, err := c.QuerySequence(ctx, &types.RequestQuerySequence{
216+
Signer: []byte("test-signer"),
217+
})
218+
219+
// With the bug: err != nil and c.Error() != nil (client stopped itself).
220+
// With the fix: err == nil, resp is valid, client remains running.
221+
require.NoError(t, err, "QuerySequence should not cause socket client error")
222+
require.NotNil(t, resp, "QuerySequence should return a response")
223+
require.NoError(t, c.Error(), "socket client should still be running without error")
224+
}
225+
198226
type blockedABCIApplication struct {
199227
wg *sync.WaitGroup
200228
types.BaseApplication

0 commit comments

Comments
 (0)