Skip to content

Incorrect key in foundry.toml fails silently #12792

@QGarchery

Description

@QGarchery

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge Version: 1.5.0-stable Commit SHA: 1c57854 Build Timestamp: 2025-11-26T09:14:24.173470686Z (1764148464) Build Profile: maxperf

What version of Foundryup are you on?

foundryup: 1.5.0

What command(s) is the bug in?

forge test

Operating System

Linux

Describe the bug

Misconfiguration in the foundry.toml file fails silently, even when adding a key-value pair that is obviously wrong. This can be a security risk if the particular configuration is critical.

Reproduce: add the entry my-key-that-doesnt-exist = 42 anywhere in the file, and notice that it won't break anything.

This is problematic when the configuration is critical. For example, if I know that a prior solidity version contains a known bug, and I want to target a newest solidity version. One can think that version = xxx would work (as in the corresponding compiler restriction key version), and be convinced that it works given that no exception are raised, when in fact solc_version = xxx should be used instead.

Ideally, a key that is not recognized would crash the program, so that this error is detected early

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions