File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,21 @@ func (suite *TransferTestSuite) TestOnAcknowledgePacket() {
414
414
errors .New ("unable to unescrow tokens" ),
415
415
false ,
416
416
},
417
+ {
418
+ // See https://github.com/cosmos/ibc-go/security/advisories/GHSA-jg6f-48ff-5xrw
419
+ "non-deterministic JSON ack serialization should return an error" ,
420
+ func () {
421
+ // Create a valid acknowledgement using deterministic serialization.
422
+ ack = channeltypes .NewResultAcknowledgement ([]byte {byte (1 )}).Acknowledgement ()
423
+ // Introduce non-determinism: insert an extra space after the first character '{'
424
+ // This will deserialize correctly but fail to re-serialize to the expected bytes.
425
+ if len (ack ) > 0 && ack [0 ] == '{' {
426
+ ack = []byte ("{ " + string (ack [1 :]))
427
+ }
428
+ },
429
+ errors .New ("acknowledgement did not marshal to expected bytes" ),
430
+ false ,
431
+ },
417
432
}
418
433
419
434
for _ , tc := range testCases {
You can’t perform that action at this time.
0 commit comments