Safeguard
Security Guides•

Who patches a vulnerable Lambda layer shared by many functions?

A fixed layer version does not update functions pinned to the old one. How to find consumers, republish, and verify when layers span accounts.

Safeguard Security Team
3 min read

The layer owner publishes a fixed layer version, and every function owner must then point to it, because a function references an exact layer version. Fixing the layer alone changes nothing for existing functions. Build a consumer list first, then roll out version by version and verify.

How layers work, per AWS

According to the AWS Lambda documentation, a layer is a .zip archive that usually holds library dependencies, a custom runtime or configuration files. Layers let you share dependencies across functions, and you can use up to five layers per function. A layer version is an immutable snapshot, each publish creates a new version number with its own ARN, and a function must name the exact version it uses.

Two details matter for security. First, immutability means an old version stays vulnerable forever, so retirement is a deliberate act. Second, layers apply to functions deployed as zip archives. Functions defined as container images package their own dependencies, so they follow your image process instead.

The risk shape

One vulnerable library in a popular layer can sit inside dozens of functions, owned by different teams, in several accounts. None of those functions list the library in their own code repository, so repository scans miss it.

A response plan

  1. Identify the layer version. Record the component and the layer version that contains it.
  2. List consumers. Find every function that references that version. If your inventory stores layer ARNs per function, this is a query.
  3. Publish the fix. Create a new layer version with the updated dependency and test it with one low risk consumer.
  4. Update consumers. Each function owner changes the reference, or a shared template does it for them.
  5. Retire the old version. Once no function uses it, stop others from adding it, following the provider documentation for your setup.
  6. Verify. Re-run the consumer query. The count for the old version should reach zero.

Questions to answer in the inventory

FieldWhy
Function name and accountWhere to apply the change
Layer ARN and versionWhether it is affected
Owning teamWho to ask
Last deployed dateFinds stale functions
Runtime versionLayer compatibility

Prevent the next scramble

Treat layers as products. Give each an owner, a changelog and a support statement. Add a component list for every layer version, so a new advisory can be matched in minutes. Avoid sharing a layer across teams without an agreed update window.

Try it yourself

Open the demo to see a dependency inventory with components listed per project. Imagine one entry per layer version in your own estate.

Click through it at your own pace, or open it full screen.

Quick check

Can I edit an existing layer version to patch it?

No. The AWS documentation describes layer versions as immutable snapshots, so you publish a new version instead.

Do container image functions use layers?

The documentation says layers apply to zip deployments. Container image functions package the runtime and dependencies in the image.

Safeguard's SBOM and dependency scanning can list components inside packaged artifacts, which helps match advisories to layers. A free scan is at gold.safeguard.sh/scan.

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.