Shentu - MultiSig

CertiKFiles named in the report

CertiK reviewed Shentu Chain (Shentu - MultiSig) on 25 Nov 2024: 15 findings, 1 critical; 12 marked fixed, 3 open.

1 critical finding, fixed
Open the reportOpen Shentu Chain’s security record

Report hosted on skynet.certik.com.

Trustblock does not review code.

Findings15

Statuses are the security firm’s own, from its report.

SeverityOpenAcknowledgedFixed
Critical001
High001
Medium205
Low105
MediumJWT Token Expiry Period Is Potentially Too LongOpen

Repository: - multisig-service File: - util/token.go The web application uses JSON Web Tokens (JWT) for authentication. Once a token has been signed by the `CreateToken function`, it remains valid for 1 month (720 hours). ```go=16 func CreateToken(hexAddr string) (string, error) { expTime := time.Now().Add(time.Hour * 720).Unix() claims := CustomClaims{ HexAddr: hexAddr, StandardClaims: jwt.StandardClaims{ ExpiresAt: expTime, }, } token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims) tokenString, err := token.SignedString(signingTokenKey) return tokenString, err } ``` While this extended validity period offers convenience by minimizing the need for frequent logins, it also introduces significant security risks. If a token is compromised (e.g., through theft or interception), the long expiration period increases the window of opportunity for malicious actors to misuse the token, potentially leading to unauthorized access to sensitive data or user accounts.

MediumReplay Attack Vulnerability Leading to JWT TokenOpen

Repository: - multisig-service File: - util/sign.go The function `VerifyADR036Sign` is potentially vulnerable to replay attacks. This vulnerability arises because the current implementation does not include mechanisms to ensure the uniqueness of each signed message. Without unique identifiers like nonce or context-specific information, an attacker could intercept a valid signed message, possibly through network sniffing or other unauthorized access methods, and resend it to gain access to the system. This could allow an attacker to obtain and reuse someone else's JWT token, enabling unauthorized access to other system functionalities. ```go=30 func VerifyADR036Sign(address, pubKey, signature, message string) bool { message = fmt.Sprintf(`{"message":"%s"}`, message) base64Msg := base64.StdEncoding.EncodeToString([]byte(message)) signMsg := fmt.Sprintf(`{"chain_id":"","account_number":"0","sequence":"0","fee":{"gas":"0","amount":[]},"msgs":[{"type":"sign/MsgSignData","value":{"signer":"%s","data":"%s"}}],"memo":""}`, address, base64Msg) sortMsg := sdk.MustSortJSON([]byte(signMsg)) // verify signature pubKeyBytes, err := base64.StdEncoding.DecodeString(pubKey) if err != nil { return false } sigBytes, err := base64.StdEncoding.DecodeString(signature) if err != nil { return false } return VerifySignature(pubKeyBytes, sigBytes, sortMsg) } ``` Replay attacks can lead to unauthorized access, allowing attackers to perform actions on behalf of legitimate users. This includes accessing sensitive data, executing transactions, or utilizing system resources, thereby compromising the security and integrity of the system.

LowUnregistered Endpoint for Account Renaming in MulOpen

Repository: - multisig-service Files: - controller/account.go - router/loader.go The function `MemAccountRename` is defined to rename a multisig account for a given user based on the provided JSON request data. **router/loader.go** ```go=44 func addMultisigEndpoints(g *gin.Engine) { multisig := g.Group("api/v1/multisig") multisig.GET("chains", controller.GetAllChainInfo) multisig.POST("account", controller.CreateAccount) multisig.GET("accounts", controller.GetAccounts) multisig.PUT("account/active", controller.ActiveAccount) multisig.PUT("account/rename", controller.WalletAccountRename) // save multisig transaction multisig.POST("tx", controller.CreateTx) multisig.POST("tx/sign", controller.SaveTxSign) multisig.DELETE("tx", controller.DelTx) multisig.PUT("tx/hash", controller.UpdateTxInfo) multisig.GET("tx/pending", controller.GetPendingTxs) multisig.GET("tx/history", controller.GetHistoryTxs) } ``` However, it is not registered as an endpoint in the `addMultisigEndpoints` function, which means the functionality cannot be accessed through the API, rendering it ineffective.

Contracts in scope

No deployed address is recorded for this audit.

The report names a repository or files. Open the report to see its scope.

Repository and files the report names (34)

  • entity/chain_info.go
  • entity/account.go
  • util/sign.go
  • cmd/generate/prepare.go
  • controller/tx.go
  • service/account.go
  • main.go
  • entity/login.go
  • dal/dao/multisig_history.gen.go
  • util/logger.go
  • entity/transaction.go
  • dal/model/multisig_account.gen.go
  • dal/model/pending_transaction.gen.go
  • service/transactions.go
  • entity/errno/code.go
  • controller/response_data.go
  • router/loader.go
  • service/chain_registry.go
  • controller/account.go
  • cmd/generate/gen.go
  • dal/dao/gen.go
  • util/tools.go
  • util/config.go
  • entity/errno/errno.go
  • dal/dao/multisig_account.gen.go
  • middleware/auth.go
  • controller/login.go
  • common/const.go
  • router/header.go
  • dal/dal.go
  • util/http.go
  • dal/dao/pending_transaction.gen.go
  • util/token.go
  • dal/model/multisig_history.gen.go

Part of Shentu Chain’s security record

Shentu Chain
Audits5 audits by 1 firmLast audit Dec 2024, by CertiK.
Critical findingsNo open critical findingsAcross the 5 reports, 1 critical finding was reported. It is marked fixed by the firm that reported it.
Open Shentu Chain’s security record

Security firm

CertiK

1,044 projects reviewed · 1,375 reports · latest May 2025

See CertiK’s audits

Something wrong on this page? A missing report, a wrong date, a finding that was fixed since. Tell us and we check it against its source.

Tell us