[bisq-network/bisq] Add irregular txType, add check for total balance, prevent proposal withhold attack (#2587)

Manfred Karrer notifications at github.com
Sun Mar 31 22:43:28 UTC 2019


ManfredKarrer commented on this pull request.



> + * Validator for extraDataMap fields used in network payloads.
+ * Ensures that we don't get the network attacked by huge data inserted there.
+ */
+ at Slf4j
+public class ExtraDataMapValidator {
+    // ExtraDataMap is only used for exceptional cases to not break backward compatibility.
+    // We don't expect many entries there.
+    public final static int MAX_SIZE = 10;
+    public final static int MAX_KEY_LENGTH = 100;
+    public final static int MAX_VALUE_LENGTH = 100000; // 100 kb
+
+    public static Map<String, String> getValidatedExtraDataMap(@Nullable Map<String, String> extraDataMap) {
+        return getValidatedExtraDataMap(extraDataMap, MAX_SIZE, MAX_KEY_LENGTH, MAX_VALUE_LENGTH);
+    }
+
+    public static Map<String, String> getValidatedExtraDataMap(@Nullable Map<String, String> extraDataMap, int maxSize, int maxKeyLength, int maxValueLength) {

Done

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/2587#discussion_r270688897
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190331/1688b4da/attachment.html>


More information about the bisq-github mailing list