Safeguard
Supply Chain•

Does a scan cover a PyInstaller or other frozen Python app?

A frozen Python executable bundles the interpreter and libraries into one file. What a source scan sees, what it misses, and how to inventory the bundle.

Safeguard Security Team
3 min read

A source scan covers the libraries you declared, but not necessarily what ended up in the frozen executable. The bundle also contains the Python interpreter and any modules the build tool discovered. To cover it, keep the build time dependency list and record the interpreter version alongside it.

What freezing does

The PyInstaller documentation explains that it bundles an application and its dependencies so users do not need to install any particular Python version or modules. It finds all the import statements in your script, locates the imported modules and looks in them for imports, building the list of what the program needs. It notes that the Python interpreter that executes PyInstaller is part of the bundle, and that output is specific to the operating system and Python version used.

So the distributed file includes a particular interpreter and a particular set of libraries, fixed at build time.

What a scan of the repository misses

ItemIn your repository scanIn the shipped executable
Declared librariesYes, if in lockfileYes
Libraries pulled in by discovery of importsMaybeYes
The interpreterNot usuallyYes
Native libraries bundled by those modulesNoYes

Because the bundle is built from imports found by analysis, it can include something your lockfile did not name directly. And because users cannot update the interpreter themselves, a flaw in it stays until you ship a new build.

How to get an accurate inventory

  1. Build from a locked environment, so the library set is known and recorded.
  2. Save the lockfile and the exact Python version with every release artifact.
  3. Generate an SBOM at build time from that environment and attach it to the release.
  4. Look at what the build tool reports as included, which most freezing tools can list, and compare with your lockfile.
  5. Treat the interpreter as a component with its own support lifecycle. See does a dependency scanner check Node, Python or the JDK.

The update problem

A normal service gets patched when you redeploy. A frozen desktop or command line tool lives on user machines. After an advisory, you must rebuild and redistribute. Plan for that: keep reproducible build scripts, and have an update channel if the tool is long lived.

Ask the right question

When an advisory lands, do not ask whether the repository uses the library. Ask whether any shipped build contains it, and which versions. The saved SBOM per release answers that quickly.

Safeguard offers SBOM and dependency scanning and a free scan at gold.safeguard.sh/scan. Keep one SBOM per shipped build, whatever tool makes it.

Quick check

Does freezing remove dependency risk?

No. It fixes the versions at build time, so risk remains until you rebuild.

Can I scan the executable directly?

Some tools can identify contents, with varying accuracy. A build time SBOM is more reliable.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.