This was generated by AI during triage.
Summary
Agent-scoped API tokens may be able to request finalization/publishing as another local custodial agent by supplying a different authorAgentAddress in the request body.
Why This Matters
This is not a Solidity token-drain issue. It is a daemon/API authorization boundary issue.
Example:
Daemon has local custodial agents:
- Alice
- Bob
Caller authenticates with Alice's agent-scoped token.
Request body says authorAgentAddress = Bob.
If body author wins, daemon signs/finalizes as Bob.
That breaks identity attribution and can let one agent token act as another local custodial agent.
Code References
packages/cli/src/daemon/routes/knowledge-assets.ts
resolveFinalizeOptions uses explicit authorAgentAddress if present, otherwise falls back to token-derived agent address.
packages/cli/src/daemon/routes/memory.ts
- shared-memory publish path has similar body/token authorship resolution logic.
packages/agent/src/dkg-agent-publish.ts
assertionFinalize can use a local custodial agent private key for authorAgentAddress.
Expected Behavior
If a request is authenticated with an agent-scoped token, finalization should either:
- force authorship to that token's agent, or
- reject any explicit
authorAgentAddress that differs from the token's agent.
Actual Behavior
The route appears to allow explicit body authorAgentAddress to override token-derived identity before passing options to agent finalization.
Validation Needed
- Add route-level tests:
- Register two local custodial agents.
- Authenticate with agent A token.
- Submit finalize/publish request with
authorAgentAddress = B.
- Verify the request is rejected.
Suggested Fix Direction
In all agent-scoped token routes, if tokenAgentAddress != null, require:
authorAgentAddress absent OR authorAgentAddress == tokenAgentAddress
Apply consistently across KA create/finalize and shared-memory publish paths.
Summary
Agent-scoped API tokens may be able to request finalization/publishing as another local custodial agent by supplying a different
authorAgentAddressin the request body.Why This Matters
This is not a Solidity token-drain issue. It is a daemon/API authorization boundary issue.
Example:
That breaks identity attribution and can let one agent token act as another local custodial agent.
Code References
packages/cli/src/daemon/routes/knowledge-assets.tsresolveFinalizeOptionsuses explicitauthorAgentAddressif present, otherwise falls back to token-derived agent address.packages/cli/src/daemon/routes/memory.tspackages/agent/src/dkg-agent-publish.tsassertionFinalizecan use a local custodial agent private key forauthorAgentAddress.Expected Behavior
If a request is authenticated with an agent-scoped token, finalization should either:
authorAgentAddressthat differs from the token's agent.Actual Behavior
The route appears to allow explicit body
authorAgentAddressto override token-derived identity before passing options to agent finalization.Validation Needed
authorAgentAddress = B.Suggested Fix Direction
In all agent-scoped token routes, if
tokenAgentAddress != null, require:Apply consistently across KA create/finalize and shared-memory publish paths.