Skip to content

Dead fs_permissions grant: foundry.toml grants read on foundry.toml and nothing reads it #83

Description

@thedavidmeister

Audit scope: whole-repo, commit 7aa85a4

Dimension 4 (code quality) · severity low

Where

  • foundry.toml:30-34, specifically line 31:
fs_permissions = [
  { access = "read", path = "foundry.toml" },
  { access = "read-write", path = "src/generated" },
  { access = "read-write", path = "meta" },
]

Problem

The repo grants read access to foundry.toml and nothing reads it. Nothing
under test/, src/ or script/ calls vm.readFile("foundry.toml"), so the
grant is dead configuration — a standing permission with no consumer, which
reads as if some test depends on it when none does.

Evidence measured

  • foundry.toml:31 grants { access = "read", path = "foundry.toml" }.
  • Zero readers of that path anywhere in the tree.

Proposed fix

Either remove the grant, or use it. Two other findings in this same audit —
#77 (GENERATED_DIR vs
the fs_permissions grant) and
#79 (MAX_LINE_LENGTH
vs a pinned [fmt]) — both propose tests that read foundry.toml through
exactly this grant, which is the better resolution: the grant stops being dead
because it becomes the mechanism that makes two restated facts assertable.

Resolve this one with those two rather than before them; deleting the grant
first would have to be reverted to land either test.

Metadata

Metadata

Labels

auditAudit findinglowAudit findingpass4Audit finding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions