Skip to content

Commit 8097860

Browse files
authored
Merge pull request #534 from splitio/fix-vulnerability
Fix vulnerability
2 parents 9ae9434 + 478ccb8 commit 8097860

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2024 Split Software, Inc.
1+
Copyright © 2025 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

client/src/main/java/io/split/client/JsonLocalhostSplitChangeFetcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ private SplitChange processSplitChange(SplitChange splitChange, long changeNumbe
4747
return null;
4848
}
4949
String splitJson = splitChange.splits.toString();
50-
MessageDigest digest = MessageDigest.getInstance("SHA-1");
50+
MessageDigest digest = MessageDigest.getInstance("SHA-256");
5151
digest.reset();
5252
digest.update(splitJson.getBytes());
5353
// calculate the json sha
5454
byte [] currHash = digest.digest();
5555
//if sha exist and is equal to before sha, or if till is equal to default till returns the same segmentChange with till equals to storage CN
56-
if (Arrays.equals(lastHash, currHash) || splitChangeToProcess.till == -1) {
56+
if (java.security.MessageDigest.isEqual(lastHash, currHash) || splitChangeToProcess.till == -1) {
5757
splitChangeToProcess.till = changeNumber;
5858
}
5959
lastHash = currHash;

0 commit comments

Comments
 (0)