Safeguard
Security Guides•

What does upstream first mean for open source security patches?

Upstream first is sending your fix to the original project before shipping it yourself. What it saves, when to deviate, and how to handle security fixes.

Safeguard Security Team
4 min read

Upstream first means you submit your patch to the original open source project, and then pull the accepted change into your own product. It avoids carrying a private fork that you must re-apply after every release. For security fixes, it also means following the project's private reporting route, not a public pull request.

Definition

The Linux Foundation guide on creating an open source program recommends that organizations adopt an upstream-first development policy. By submitting patches to the upstream project first, and incorporating them downstream, you avoid spending a large amount of time and money on re-engineering after each release.

Upstream is the project you depend on. Downstream is your product or fork. The policy sets the direction of flow: fixes go up, then come back down in a release.

Why it pays off

  • Less drift. A private fork diverges with every upstream release, and merging gets harder each time.
  • More eyes. Maintainers and other users review your change.
  • Shared fix. Other users stop hitting the same bug, and you stop paying alone.
  • Cleaner audit story. You can say the fix is in a public release, not a one-off patch.

The security twist

A security fix is different from a feature. Publishing the exploit details in a public pull request before a release can put every user at risk. The right sequence is:

  1. Check the project's security policy (a SECURITY.md file or a private reporting channel).
  2. Report privately and offer a patch if the maintainers want one.
  3. Agree on a disclosure timeline.
  4. Ship a temporary mitigation downstream if you cannot wait.
  5. Remove the temporary patch once the upstream release lands.

If you are the reporter and unsure how, see how to report a vulnerability in an open source project.

When not to go upstream first

SituationBetter move
The change is specific to your business logicKeep it in your own layer
The project is abandonedFork, with an owner and a review date
The change contains confidential code or dataDo not send it, rewrite it clean
The maintainers decline the designCarry the patch deliberately, with a written reason

An abandoned project is its own risk class. See how to tell if an open source project is still maintained.

What to write in your policy

Three sentences are enough for a small company:

  1. We send generic fixes to the upstream project before shipping them.
  2. Security issues go through the project's private channel, never a public issue.
  3. Any patch we carry has an owner, a ticket and a review date.

Tracking carried patches

Each local patch is a debt. Record it with the upstream issue link, the component version, and the condition for removal. Review the list whenever you upgrade the component. A patch that has been merged upstream should be deleted, not kept as a safety net.

Safeguard's SBOM and dependency scanning shows which component versions you ship, and autonomous remediation can open fix pull requests for upgrades. It is off by default, with every category set to Manual, so a person approves each change. See a free scan at gold.safeguard.sh/scan.

Try it yourself

Click through it at your own pace, or open it full screen. Look at how an upstream fix turns into an upgrade you can review.

Quick check

Does upstream first slow down a security fix?

It can, if you wait on a release. Apply a documented temporary mitigation downstream and remove it when the upstream release ships.

Can we contribute a security fix as a normal pull request?

Not until the maintainers agree. Use the private reporting route first, then follow the disclosure timeline.

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.