nspcc-dev/neo-go

Find a replacement for JSON library

Aberta

#3.226 aberto em 23 de nov. de 2023

 (2 comentários) (0 reação) (0 responsável)Go (108 forks)auto 404
I4S2U4dependenciesenhancementgohelp wanted

Métricas do repositório

Stars
 (132 estrelas)
Métricas de merge de PR
 (Mesclagem média 4d 19h) (16 fundiu PRs em 30d)

Description

Is your feature request related to a problem? Please describe.

Currently it's possible to perform DOS to RPC server using RPC requests with high depth. NeoC# doesn't have such problem since https://github.com/neo-project/neo/pull/2912 and https://github.com/neo-project/neo-modules/pull/827. However, for us it's not that easy because neither standard JSON nor ordered JSON supports nested JSON depth restriction. But this limit is restricted by default by 10000, see https://github.com/golang/go/issues/31789 and https://github.com/golang/go/commit/84afaa9e9491d76ea43d7125b336030a0a2a902d.

Describe the solution you'd like

We need to find some other JSON library that allows to restrict maximum allowed JSON depth. Ref. https://github.com/nspcc-dev/neo-go/pull/3221#discussion_r1403335833.

Guia do colaborador