Skip to content

FLOW-7: Sentinel Hygiene: Reserved NO_YIELDVAULT_ID and Create Placeholder Id #22

@liobrasil

Description

@liobrasil

Severity: Low

Description

Two related issues with sentinel value handling:

1. NO_YIELDVAULT_ID can be registered

The sentinel value NO_YIELDVAULT_ID = type(uint64).max (line 108) is intended to represent "no vault", but _registerYieldVault() (lines 1478-1491) has no guard preventing this value from being registered as a valid vault ID.

2. CREATE requests use 0 instead of NO_YIELDVAULT_ID

When creating a CREATE_YIELDVAULT request (line 771), the contract uses 0 as the placeholder yieldVaultId. However, 0 can be a valid yieldVaultId (per comment at line 107), creating ambiguity. The comment at line 64 states it should use NO_YIELDVAULT_ID.

Recommendation

  • Reject registering NO_YIELDVAULT_ID
  • Initialize CREATE requests with yieldVaultId = NO_YIELDVAULT_ID until completion assigns the real ID

Parent Issue: #15

Metadata

Metadata

Assignees

Labels

LowLow severity security finding⎈ QuantStampQuantStamp audit finding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions