Skip to content

fix: the provider cache in packages/fuels-accounts/s... in cache.rs#1711

Open
orbisai0security wants to merge 1 commit intoFuelLabs:masterfrom
orbisai0security:fix-fix-v-003-bounded-cache-ttl-and-clear
Open

fix: the provider cache in packages/fuels-accounts/s... in cache.rs#1711
orbisai0security wants to merge 1 commit intoFuelLabs:masterfrom
orbisai0security:fix-fix-v-003-bounded-cache-ttl-and-clear

Conversation

@orbisai0security
Copy link
Copy Markdown

Summary

Fix high severity security issue in packages/fuels-accounts/src/provider/cache.rs.

Vulnerability

Field Value
ID V-003
Severity HIGH
Scanner multi_agent_ai
Rule V-003
File packages/fuels-accounts/src/provider/cache.rs:267

Description: The provider cache in packages/fuels-accounts/src/provider/cache.rs uses time-based TTL expiry of approximately 11 seconds. No maximum entry count or memory size limit has been confirmed in the cache implementation. If the underlying data structure is an unbounded HashMap or similar growable collection, an attacker or high-traffic workload that triggers cache lookups with many distinct keys (e.g., thousands of unique account addresses or block heights) can cause the cache to grow without bound. At a request rate exceeding the TTL expiry rate, entries accumulate faster than they are evicted, eventually exhausting heap memory. Confidence is low because the full cache data structure was not directly inspected beyond the referenced lines.

Changes

  • packages/fuels-accounts/src/provider/cache.rs

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
@orbisai0security orbisai0security requested a review from a team as a code owner April 20, 2026 05:41
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 20, 2026

PR Summary

Medium Risk
Medium risk because it changes the public TtlConfig API (new required node_info field) and alters caching behavior for node_info, which could affect downstream code and performance characteristics.

Overview
Introduces an independent cache TTL for node_info by extending TtlConfig with a new node_info duration (defaulting to 60s) and using it in CachedClient::node_info() instead of reusing the consensus-parameters TTL.

Updates CachedClient::clear() to also invalidate the node_info cache, and adjusts unit tests to construct TtlConfig with the new field.

Reviewed by Cursor Bugbot for commit e0e2a1b. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant