Chromia FT4 (token library)

QuantstampFiles named in the report

Quantstamp reviewed Chromia (Chromia FT4 (token library)) on 21 Jun 2024: 10 findings, 0 critical; 8 marked fixed, 2 acknowledged.

No open critical findings
Open the reportOpen Chromia’s security record

Report hosted on certificate.quantstamp.com.

Trustblock does not review code.

Findings10

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

SeverityOpenAcknowledgedFixed
Critical000
High000
Medium002
Low026
MediumPossible for New `main_auth_descriptor` to Be Missing the `A` or `T` FlagsFixed

The most privileged auth descriptor for an account is the main auth descriptor. On account creation, the main auth descriptor requires both the Account flag and the Transfer flag (`A` and `T` flags respectively). This gives it access to all account and transfer operations. Additionally, the main auth descriptor is the only auth descriptor that can call `update_main_auth_descriptor()`. However, the new main auth descriptor is not validated to have the `A` and `T` flags. This could leave the account in a state where no auth descriptors are capable of account or transfer operations, potentially locking all funds held by the account.

MediumPossible to Have `signatures_required == 0` for a Multi-Sig Auth DescriptorFixed

`add_auth_descriptor()` makes a call to `validate_auth_descriptor_args()`. Unlike `validate_auth_descriptor_rules()`, `validate_auth_descriptor_args()` doesn't perform any validation on the auth descriptor. This makes it possible to set `signatures_required == 0` for the `multi_sig_args`. In the case of `ft_auth`: Given how the `for` loop in `check_multi_sig_auth()` works, at least one signature is required to reach the `if` statement checking whether the number of signatures has been reached. However, should this implementation ever change, the vulnerability may leak through. In the case of `evm_auth`: `signatures_required == 0` allows **anyone** to use the auth descriptor.

Low`get_account_by_auth_descriptor` Query Is BrokenFixed

The `get_account_by_auth_descriptor()` query assumes that the `account.id == auth_descriptor.hash()`. However, the `account.id` is not constructed in this way. The query will mistakenly return `null`.

LowAdmin Can Exceed Max Rate Limit PointsFixed

In `rell/src/lib/ft4/external/admin/operations.rell`, the function `add_rate_limit_points()` has no validation on `amount`, which could allow the admin to exceed `rl_config.max_points` (or alternatively input a negative number). Notably, this may affect priority check calculations in `rell/src/lib/ft4/core/prioritization/default/module.rell`. The calculated `priority` value appears to normally fall into the range `[0.0, 1.0]`, however this invariant may break if an improper amount of points are added.

LowMalformed Message for `delete_all_auth_descriptors_except_main`Fixed

The function `delete_all_auth_descriptors_except_main_message(gtv)` returns the following string: `Please sign the message\nto delete all auth descriptors except main:\n%s\n\n from account:\n{account_id}`. Note that it contains a "%s" however the function does not invoke `format()` on the string. The `gtv` parameter is unused, and its not clear how the `account_id` will be populated. If the string goes unformatted, the message can be used for any `account_id`.

LowMessages Are Not Guaranteed to Be Unique for Each OperationFixed

`generate_operation_auth_message()` generates a message for an operation for users to sign. Backslashes are removed from the arguments before being added to the message. This loss of information results in differing arguments conforming to the same message. For example, `"\ ".replace("\"", "") == " \".replace("\"", "")`. In this scenario, both messages could be signed with the same signatures.

LowMissing Input ValidationFixed

It is important to validate inputs, even if they only come from trusted addresses, to avoid human error. The following functions would benefit from additional validation: - `register_crosschain_asset()`: Parameters `origin_blockchain_rid` and `issuing_blockchain_rid` are not checked to be different from `chain_context.blockchain_rid`. - `create_rate_limiter_state_for_account()`: Value `points_at_start` not checked to be lower than `rl_config.max_points`.

LowOff-by-One Error on Max RulesFixed

In `validate_auth_descriptor_rules()`, the length of `rules_gtv` is validated with the following line in the `else` branch: ``` require(rules_gtv.size() <= chain_context.args.auth_descriptor.max_rules, "Too many rules"); ``` Since "and" occupies slot 0, this only permits `max_rules - 1`.

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 (130)

  • ft4/external/accounts/queries.rell
  • utils.ts
  • ft4/core/accounts/strategies/transfer/subscription/config.rell
  • ft4/core/assets/extensions.rell
  • web3-generic.ts
  • browser-login-keystore.ts
  • ft4/prioritization/default/module.rell
  • ft4/core/accounts/strategies/transfer/queries.rell
  • in-memory.ts
  • ft4/external/crosschain/operations.rell
  • ft4/core/accounts/strategies/transfer/open/module.rell
  • type-predicates.ts
  • ft4/core/prioritization/module.rell
  • operations.ts
  • ft4/core/assets/module.rell
  • ft4/accounts/module.rell
  • subscription.ts
  • asset-query-functions.ts
  • ft4/core/prioritization/default/module.rell
  • main.ts
  • asset-queries.ts
  • ft4/assets/module.rell
  • ft4/external/admin/module.rell
  • transfer-history-queries.ts
  • transaction-signer.ts
  • web3-provider.ts
  • ft4/external/assets/locking/module.rell
  • admin-operations.ts
  • enum-parsers.ts
  • ft4/assets/locking/module.rell
  • ft4/external/accounts/module.rell
  • ft4/external/assets/module.rell
  • transfer-history-query-functions.ts
  • enum-parser.ts
  • ft4/accounts/strategies/transfer/open/module.rell
  • ft4/core/accounts/strategies/auth_message.rell
  • ft4/external/assets/locking/queries.rell
  • ft4/core/accounts/strategies/transfer/subscription/queries.rell
  • ft4/core/accounts/auth_descriptor_rule_validation.rell
  • ft4/accounts/strategies/transfer/fee/module.rell
  • ft4/external/accounts/strategies/module.rell
  • ft4/accounts/strategies/transfer/subscription/module.rell
  • error.ts
  • ft4/utils/pagination.rell
  • ft4/external/admin/operations.rell
  • errors.ts
  • ft4/external/auth/operations.rell
  • ft4/external/accounts/operations.rell
  • types.ts
  • orchestrator.ts
  • ft4/utils/utils.rell
  • operators.ts
  • ft4/external/crosschain/queries.rell
  • emitter.ts
  • ft4/core/accounts/strategies/transfer/subscription/module.rell
  • exposed-operations.ts
  • ft4/prioritization/module.rell
  • gtv.ts
  • ft4/external/accounts/strategies/operations.rell
  • handlers.ts
  • open.ts
  • ft4/crosschain/module.rell
  • index.ts
  • ft4/external/crosschain/module.rell
  • ft4/core/accounts/strategies/transfer/module.rell
  • ft4/core/crosschain/module.rell
  • ft4/core/accounts/auth_external.rell
  • admin-op-functions.ts
  • local-storage.ts
  • ft4/test/utils.rell
  • transfer-history-entry.ts
  • ft4/module.rell
  • transaction-builder.ts
  • ft4/core/admin/module.rell
  • ft4/accounts/strategies/module.rell
  • transfer.ts
  • ft4/core/assets/locking/module.rell
  • ft4/core/accounts/auth_flags_config.rell
  • ft4/auth/module.rell
  • ft4/core/auth/module.rell
  • pathfinder.ts
  • directory-chain.ts
  • ft4/external/auth/module.rell
  • ft4/accounts/linking/module.rell
  • ft4/core/accounts/rate_limit.rell
  • queries.ts
  • ft4/core/accounts/strategies/transfer/fee/config.rell
  • ft4/admin/crosschain/module.rell
  • ft4/external/accounts/strategies/queries.rell
  • ft4/external/assets/queries.rell
  • ft4/core/crosschain/blockchain.rell
  • auth-descriptor.ts
  • ft4/core/accounts/strategies/module.rell
  • ft4/core/accounts/strategies/transfer/fee_config.rell
  • op-functions.ts
  • ft4/core/accounts/strategies/transfer/config_utils.rell
  • ft4/core/accounts/strategies/transfer/fee/queries.rell
  • ft4/core/accounts/linking/model.rell
  • ft4/core/auth/authentication.rell
  • ft4/core/accounts/module.rell
  • ft4/core/auth/login.rell
  • ft4/accounts/strategies/open/module.rell
  • ft4/core/crosschain/extensions.rell
  • ft4/core/accounts/strategies/transfer/fee/module.rell
  • variables.ts
  • ft4/core/accounts/auth_descriptor_rule_expression.rell
  • ftEventEmitter.ts
  • key-handler.ts
  • ft4/core/assets/asset.rell
  • ft4/accounts/strategies/transfer/module.rell
  • ft4/external/auth/queries.rell
  • query-functions.ts
  • ft4/external/assets/operations.rell
  • in-memory-keystore.ts
  • ft4/admin/module.rell
  • ft4/external/admin/crosschain/module.rell
  • session-storage.ts
  • ft4/core/assets/locking/functions.rell
  • entity-retriever.ts
  • ft4/core/accounts/strategies/transfer/config.rell
  • ft4/core/crosschain/transfer.rell
  • ft4/core/assets/transfer.rell
  • ft4/core/accounts/strategies/open/module.rell
  • fee.ts
  • ft4/core/accounts/linking/module.rell
  • amount.ts
  • ft4/core/assets/history.rell
  • ft4/core/accounts/auth_basic.rell
  • evaluation.ts
  • ft4/version.rell

Part of Chromia’s security record

Chromia
Audits2 audits by 1 firmLast audit Oct 2024, by Quantstamp.
Critical findingsNo open critical findingsAcross 2 reports.
Open Chromia’s security record

Security firm

Quantstamp

236 projects reviewed · 332 reports · latest Oct 2026

See Quantstamp’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