fix: Add more account check (#1543)

Make sure all char is alphanumeric for account
This commit is contained in:
cyan317
2024-07-15 16:42:12 +01:00
committed by GitHub
parent b12d916276
commit d6598f30f1
11 changed files with 183 additions and 37 deletions

View File

@@ -22,6 +22,7 @@
#include "rpc/Errors.hpp"
#include "rpc/RPCHelpers.hpp"
#include "rpc/common/Types.hpp"
#include "util/AccountUtils.hpp"
#include "util/TimeUtils.hpp"
#include <boost/json/object.hpp>
@@ -133,7 +134,7 @@ CustomValidator CustomValidators::AccountBase58Validator =
if (!value.is_string())
return Error{Status{RippledError::rpcINVALID_PARAMS, std::string(key) + "NotString"}};
auto const account = ripple::parseBase58<ripple::AccountID>(boost::json::value_to<std::string>(value));
auto const account = util::parseBase58Wrapper<ripple::AccountID>(boost::json::value_to<std::string>(value));
if (!account || account->isZero())
return Error{Status{ClioError::rpcMALFORMED_ADDRESS}};