You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Open items are tracked in [`IMPROVEMENT.md`](./IMPROVEMENT.md): the most severe is admin-path call
144
+
topology (item 2); also authorization granularity (item 1) and enumeration cost (item 4).
145
145
- CMTAT v3 no longer ships a *standalone* token that consumes an external document engine through its constructor; the standard token stores documents on-chain (`DocumentERC1643Module`). External-engine integration now goes through CMTAT's `DocumentEngineModule` (`setDocumentEngine`). The test suite was updated to exercise this real integration path via a minimal token built on `DocumentEngineModule`.
Copy file name to clipboardExpand all lines: IMPROVEMENT.md
+84-47Lines changed: 84 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,80 +23,117 @@ tracked separately under [`doc/audits/tools/`](./doc/audits/tools).
23
23
24
24
| # | Item | Severity | Effort | Kind |
25
25
| --- | --- | --- | --- | --- |
26
-
|[1](#1--authorization-is-not-per-subject-and-the-hook-cannot-express-it)| Authorization is not per-`subject`, and the hook cannot express it |**High**| Medium |Spec `MUST`|
26
+
|[1](#1--authorization-granularity-is-fixed-at-compile-time-the-hook-cannot-express-per-subject-rules)| Authorization granularity is fixed at compile time; the hook cannot express per-`subject` rules | Low¹| Medium |Extensibility|
|[3](#3--the-engine-advertises-ierc1643-but-is-not-a-usable-erc-1643-endpoint)| Engine advertises `IERC1643` but is not a usable ERC-1643 endpoint | Low | Trivial | Docs |
29
29
|[4](#4--enumeration-cost-and-removal-complexity)| Enumeration cost and removal complexity | Low | Medium | Gas |
30
30
|[5](#5--the-erc-2771-forwarder-is-a-universal-write-authority)| ERC-2771 forwarder is a universal write authority | Info | Trivial | Docs |
31
31
|[6](#6--_removedocument-emits-before-the-state-change)|`_removeDocument` emits before the state change | Info | Trivial | Cosmetic |
> covers every subject, so unrelated issuers should each deploy their own engine rather than share
10
+
> one).
5
11
6
12
The `DocumentEngine` is an external contract to manage documents through [*ERC-1643*](https://github.com/ethereum/EIPs/issues/1643), a standard proposition to manage document on-chain. This standard is notably used by [ERC-1400](https://github.com/ethereum/eips/issues/1411) from Polymath.
Copy file name to clipboardExpand all lines: doc/audits/AUDIT_OVERVIEW.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ detail, with a recommendation for each, in [`IMPROVEMENT.md`](../../IMPROVEMENT.
56
56
57
57
| Item | Severity | Where |
58
58
| --- | --- | --- |
59
-
|Authorization is not per-`subject`, and `_authorizeDocumentManagement()` takes no `subject`, so a deployment cannot make it per-subject by overriding the hook| High| item 1 |
59
+
|`_authorizeDocumentManagement()` takes no `subject`, so a deployment cannot make authorization per-subject by overriding the hook. Conformant for the single-issuer fleet the engine targets — `DOCUMENT_MANAGER_ROLE` is permitted to manage every subject — but it means one instance serves one trust domain | Low (Medium if shared across unrelated issuers)| item 1 |
60
60
| Admin write path has no execution point in the subject, so an ERC-1643 subject emits nothing for writes sent straight to the engine | Medium | item 2 |
61
61
| Engine advertises `IERC1643` but its base functions are `_msgSender()`-scoped, so it is not a usable endpoint for an external consumer | Low | item 3 |
62
62
|`_removeDocumentName` is O(n); no paginated enumeration | Low | item 4 — also surfaced by Aderyn L-5 |
Copy file name to clipboardExpand all lines: doc/audits/tools/v0.4.0/aderyn/aderyn-report-feedback.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ CMTAT upgrade.
30
30
31
31
| ID | Detector | Sev | Instances | Disposition | Reason (verified against the cited lines) |
32
32
| --- | --- | --- | --- | --- | --- |
33
-
| L-1 | Centralization Risk | Low | 2 |**By design**|`DocumentEngine.sol:24`, `DocumentEngineOwnable.sol:24`. The whole premise of the contract is that a trusted operator manages documents for a fleet of subjects; `DOCUMENT_MANAGER_ROLE` (and `owner`) are that operator. Documented in the README and analysed in `IMPROVEMENT.md` item 1, which argues the privilege should be *narrowed to per-subject*, not removed. Aderyn cannot express that distinction. |
33
+
| L-1 | Centralization Risk | Low | 2 |**By design**|`DocumentEngine.sol:24`, `DocumentEngineOwnable.sol:24`. The whole premise of the contract is that a trusted operator manages documents for a fleet of subjects; `DOCUMENT_MANAGER_ROLE` (and `owner`) are that operator. Documented in the README and analysed in `IMPROVEMENT.md` item 1, which concludes the global role is the correct model for the single-issuer fleet this engine targets. Aderyn cannot express that distinction. |
34
34
| L-2 | Unspecific Solidity Pragma | Low | 9 |**By design**| Every file uses `pragma solidity ^0.8.20;`. The caret is intentional so the sources stay consumable as a library by projects on a different `0.8.x`; the compiler actually used for the deployed bytecode is pinned to `0.8.34` in `foundry.toml`, and `foundry.lock` pins every dependency. Verified: no file uses a construct that behaves differently across the allowed range. |
35
35
| L-3 | PUSH0 Opcode | Low | 9 |**Environment**| Consequence of `^0.8.20` plus `evm_version = prague`: the compiler emits `PUSH0`, which is unavailable on chains that have not adopted Shanghai. Not a source defect. A deployer targeting such a chain must lower `evm_version` in `foundry.toml` — but CMTAT v3 itself requires `prague`, so that configuration is out of scope for this engine. |
36
36
| L-4 | Loop Contains `require`/`revert`| Low | 4 |**By design**|`DocumentEngineBase.sol:124, 142, 156, 170` — the four batch loops. The reverts are raised inside `_setDocument` / `_removeDocument` (`ERC1643InvalidName`, `MultiDocumentInvalidSubject`, `ERC1643MissingDocument`). Batch operations are deliberately **all-or-nothing**: a batch containing one bad entry must not half-apply, since partial application would leave the operator unable to tell which documents were written without re-reading every entry. Skipping bad entries instead would silently drop them. |
0 commit comments