Skip to content

The published rain-sol-codegen package ships no dependency metadata, and the README never names the forge-std version its imports require #82

Description

@thedavidmeister

Audit scope: whole-repo, commit 7aa85a4

Dimension 3 (documentation) · severity medium

Where

  • published rain-sol-codegen~0.1.11
  • README.md:23-29 (the Install section)

Problem

The 0.1.11 zip has 18 entries: no foundry.toml, no soldeer.lock, no
remappings.txt. All three libraries hard-import forge-std by an exact,
version-pinned prefix — src/lib/LibCodeGen.sol:5, src/lib/LibFs.sol:5 and
src/lib/LibHexString.sol:5 are each:

import {Vm} from "forge-std-1.16.1/src/Vm.sol";

So a consumer following the README's Install section gets a package that cannot
compile the moment they import anything from it, and the README never names
forge-std, its version, or the prefix. The Install section is two lines of
forge soldeer install rain-sol-codegen~<version> and nothing else — no
prerequisite is stated anywhere in the file.

Evidence measured

  • published 0.1.11 zip: 18 entries, none of which is foundry.toml,
    soldeer.lock or remappings.txt.
  • 3 of 3 src/lib/*.sol files import the literal prefix
    forge-std-1.16.1/src/Vm.sol; there is no remapping shipped that could
    redirect it.
  • sibling package rain-math-float~0.1.7 also ships no foundry.toml.

Proposed fix

A sibling (rain-math-float~0.1.7) ships no foundry.toml either, so that is
org convention and the package is not where this gets fixed. The README is:
state the forge-std version and import prefix the package requires, as an
install prerequisite.

Related

#76 — the published
package is never compiled as published. A CI job that builds the filtered tree
would also be the thing that keeps this README prerequisite honest, since it has
to supply forge-std to build at all.

Metadata

Metadata

Labels

auditAudit findingmediumAudit findingpass3Audit finding

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions