Skip to content

security: host-app allowlist for perry.nativeLibrary and perry.compilePackages #497

Description

@proggeramlug

Today, any package in the dep graph can declare perry.nativeLibrary (linking arbitrary native code) or perry.compilePackages (compiling untrusted TS into the binary), and Perry accepts it silently. These are the two attack surfaces Perry itself introduced over Node — they should require explicit host-app opt-in.

Mechanism

Read perry.allow.nativeLibrary and perry.allow.compilePackages from the host's package.json only — never from deps. At resolve time, if a transitive dep introduces either one and isn't in the host's allowlist, fail with a clear message:

package X declares perry.nativeLibrary but is not in your host package.json's perry.allow.nativeLibrary — review the package and add it explicitly.

Zero runtime cost (compile-time refusal).

Acceptance

  • Host package.json keys: perry.allow.nativeLibrary: ["pkg-a"], perry.allow.compilePackages: [...]
  • Transitive dep introducing either fails build with clear message naming the package
  • Wildcards supported ("@scope/*") for trusted scopes
  • perry audit lists deps that would need allowlisting
  • Default behavior on greenfield projects: nothing allowed

Part of the supply-chain hardening series. Closes the two attack surfaces Perry itself introduced. Host-app-controlled. Zero runtime cost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew capability or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions