The Vendored-Code Origin Trace: Copied Trees to Graded, Pinned Records
Take any repo, find every copied third-party tree or file, pin each to an upstream commit with a graded match, and write a record your SBOM and advisory checks can use.
Key takeaways
- Published audits put the share of open source components that enter codebases outside package management at 16% to 23%, and none of them separates vendored source from AI-pasted snippets and binaries, so you have to measure your own repo.
- A file's git blob SHA is the same as its Software Heritage content identifier, so you can check git hash-object output against an archive of more than 27 billion unique source files without paying for a commercial knowledge base.
- Grade every vendored component as exact, patched, closest-commit, or unknown. No published match thresholds exist, so write the rule you used into the record itself.
- If you record a patched copy under the upstream purl and version, it will match advisories it has already fixed or hide the fix. Give it a local identity and put the upstream in pedigree ancestors with a patch list.
- OSV GIT ranges use full-length commit hashes ordered by graph reachability, so only a record pinned to a commit can be checked against them. GitHub's innersource advisories do not process GIT ranges at all.
- In Refolk's index, 202 senior-and-above profiles in the US have SBOM in the headline, against 18 in Germany. That is an 11.2x gap in the specialist pool.
This playbook is for engineering managers, technical founders, devrel leads and sourcers who have third-party source copied into a repo with no manifest entry, and need to know whether a given advisory affects them. It covers the whole job: finding copied trees and single-file drops, matching each one to an upstream commit with a stated identity grade, separating out your local patches, and writing one pinned record per component that an SBOM generator and an advisory lookup can both consume.
Why is vendored code missing from your SBOM?
Manifest-driven scanners build their inventory from lockfiles and package manager records, so code copied straight into the tree never shows up. Published audit figures put the share of open source components entering codebases outside package management at somewhere between 16% and 23%, depending on which report and which year you read.
Vendored code here means third-party source committed directly into your repository, either as a whole tree or as single files, instead of being pulled in by a package manager. The published figures do not agree with each other:
| Source | Undeclared share | Year |
|---|---|---|
| Black Duck OSSRA page | 16% | latest |
| Plexicus summary of OSSRA | 17% | 2026 |
| Security Buzz on OSSRA | 23% | 2025 |
The same OSSRA page reports an average of 1,180 components per codebase and license conflicts in 68% of codebases. The 2025 edition audited 965 codebases across 16 industries. Every one of these shares combines three different things: vendor code copied into repos, snippets pasted from Stack Overflow or AI assistants, and binary components with no source. Nobody has published how the gap splits between them. So read the range as evidence that the gap is real, not as an estimate for your repo. Running the trace below is how you measure your own number.
Why you need the answer before you need the document
The EU Cyber Resilience Act sets the two obligations on different clocks:
- Article 14 reporting applies from 11 September 2026: an early warning within 24 hours, a notification within 72 hours, and a final report within 14 days of the fix.
- The Annex I Part II(1) SBOM requirement applies from 11 December 2027 and covers at least top-level dependencies.
- Fines for breaches of Annex I and Articles 13 and 14 go up to €15M or 2.5%.
This means you have to be able to answer "are we affected" for vendored code before you are required to document it. In the US, CISA's draft Minimum Elements add hash, license, tool name and generation context to the required fields. The pinned record in this guide carries all four.
Which signals reveal copied third-party code?
No single signal finds every copy. Conventional vendor paths and git metadata find the copies that were made openly. Only hashing every tracked file finds the ones that were renamed, re-headed, or merged in file by file. Treat each signal below as a lead to hash, never as an inventory.
For each signal, here is what it proves and what it looks like when it misleads you:
- Linguist vendor paths and
linguist-vendoredin.gitattributes. Linguist is GitHub's language detector. It treats the paths in its vendor.yml as vendored, and.gitattributescan override that. Proves: someone once considered the path third-party. Misleads: the flag only changes GitHub's language statistics, not diff behaviour, and copies outside the conventional paths never get flagged. .gitmodulesentries. Proves: an upstream URL and a pinned commit exist. Misleads: the URL may point to a mirror or a fork rather than the canonical upstream. Canonicalize it before you trust it.- Subtree commit trailers.
git subtreewritesgit-subtree-dirandgit-subtree-splitlines into commit messages. Proves: which upstream commit was imported at that moment. Misleads: it says nothing about local edits made after the import, or about squashed re-pulls. - LICENSE or COPYING files below the repo root. Proves: a third-party boundary probably sits in that directory. Misleads: single-file drops almost never bring a license file, and license files are common blobs that match thousands of projects.
- SPDX headers and copyright lines naming another party. An SPDX header is a
SPDX-License-Identifier:comment at the top of a file. Proves: the file was written elsewhere. Misleads: headers get rewritten when someone re-heads copied code, and that is exactly the case you most need to catch. - Version macros and constants. Proves: the version the original author shipped. Misleads: nobody bumps the string after a local patch or a cherry-pick, so it describes what someone hoped they copied.
Manifest scanners have other blind spots too, such as statically linked binaries and container base-image contents beyond the package manager's own records. They are real, but they are out of scope here. One limit to state plainly: I found no primary source that evaluates submodule metadata, subtree trailers, license headers or version macros as detection signals. The order above reflects practitioner judgement, not a measured recall rate. Check it against your own repos by recording which signal first caught each confirmed copy.
The origin-trace procedure, step by step
The trace has eight steps, from a discovery sweep to an advisory check, and each step has a defined done state. The durations are my desk estimates, because no source publishes timings, so time your first repo and adjust.
Copied tree to pinned, graded record
- Sweep the repo for discovery signalsGrep for Linguist vendor paths, .gitattributes, .gitmodules, subtree trailers, LICENSE and COPYING files below the root, SPDX headers and version macros. Done means a list of candidate paths, in about an hour per repo.
- Hash every tracked fileRun git ls-files -s across the whole repo, not just the candidates. Done means a table mapping path to blob SHA, in minutes.
- Look up blobs to identify the originLook up blob SHAs as content SWHIDs in Software Heritage, or check them against a clone of the suspected upstream. Done means a canonical origin URL for each candidate, in 1 to 2 hours.
- Select the closest upstream commitFor each tag, then untagged commits if needed, count matching distinctive blobs and take the maximum. Done means ref, full commit hash and match share recorded, in 1 to 4 hours.
- Extract the local patch deltaDiff the copy against the chosen commit and split the result into one patch per logical change. Done means a patch set, or an explicit empty delta, for each component.
- Confirm the licenseThe engineer reads the upstream license at the chosen commit and legal confirms it. Done means an SPDX license identifier.
- Write and validate the pinned recordWrite a CycloneDX component with pedigree ancestors and patches, or SPDX packages linked by PATCH_FOR. Done means the record validates against its schema.
- Run the advisory checkSecurity checks OSV GIT ranges against the pinned commit, then checks the patch list for the fix. Done means a verdict for every relevant advisory.
Two facts make steps 2 to 4 cheap. First, a SWHID (Software Heritage persistent identifier) for a content object uses the Git blob identifier of the file as its object ID. So the output of git hash-object is already a lookup key, in the form swh:1:cnt:<blob sha>. Second, the archive is large: Software Heritage reports more than 27 billion unique source files from over 421 million projects. Its provenance API, which the swhd tool uses, returns an origin together with the release or revision that contains the artifact. You can do the whole lookup without a commercial knowledge base. The catch is that it only matches byte-identical files.
Sources disagree on order. Commercial software composition analysis (SCA) tools usually run license and snippet scanning before identity. I put identity first because both the license step and the advisory step need to know which upstream commit you actually have. A license header can be wrong in a copy in exactly the way a version macro can be.
# 1. Discovery: leads, not an inventory
git ls-files | grep -Ei '(^|/)(vendor|third_party|thirdparty|external|deps)/'
git ls-files -z | xargs -0 git check-attr linguist-vendored -- | grep -E ': (set|true)$'
cat .gitmodules 2>/dev/null
git log --all --grep='git-subtree-' --format='%H %b'
git ls-files | grep -Ei '/(LICENSE|COPYING)[^/]*$'
git grep -l 'SPDX-License-Identifier'
git grep -nE '#define [A-Z_]*VERSION'
# 2. Blob SHA for every tracked file (blob SHA = content SWHID object id)
git ls-files -s | awk '{print $2, $4}' > all-blobs.txt
git ls-files -s -- third_party/foo | awk '{print $2}' | sort -u > foo-blobs.txt
# remove common blobs (LICENSE, empty files) from foo-blobs.txt before counting
# 3. In a clone of the candidate upstream: matching blobs per tag
for ref in $(git tag); do
git ls-tree -r "$ref" | awk '{print $3}' | sort -u > /tmp/ref-blobs.txt
n=$(comm -12 /path/to/foo-blobs.txt /tmp/ref-blobs.txt | wc -l)
echo "$n $ref $(git rev-parse "$ref^{commit}")"
done | sort -rn | head
# repeat over: git rev-list --all if no tag clearly wins
# Re-headed single file: normalize, then hash both sides the same way
tr -d '\r' < path/to/file.c | git hash-object --stdinRun the first two blocks in your repo and the third in a clone of the candidate upstream; swap third_party/foo for each component path.
Who can run this trace, and where to find them
Most teams can run the procedure with one engineer, plus legal for the license step. Grading ambiguous copies and writing pedigree records is specialist work, though, and the pool of specialists is thin. In Refolk's index of professional profiles, 202 senior-and-above people in the US have "SBOM" in their headline, against 18 in Germany.
| Query in Refolk's index | US | Germany | US:DE |
|---|---|---|---|
| "software supply chain security SBOM", all levels | 18 | 3 | 6.0x |
| "SBOM", Senior+ | 202 | 18 | 11.2x |
| Noise in top-10 employers | 3 of 10 | 1 of 10 | - |
Some practical reads from those counts:
- The broad keyword is noisy. "SBOM" matched unrelated employers such as Snom, SBLM Architects and Tata 1mg. In the German set, Snom alone accounted for 3 profiles, 17% of the set. Raw headline counts overstate the pool.
- The US pool sits in security vendors. Named employers in the US matches include ReversingLabs, Chainguard, Black Duck and IBM (2 profiles).
- The German pool runs through open source governance. The matches include the OWASP Dependency-Track co-lead and a self-described "FOSS Compliance Expert", which suggests consultancies and project maintainers rather than in-house product security teams.
If you want someone who has already worked with content hashes and commit ranges, the best place to look is contributors to the specifications themselves. Filtering out keyword noise by hand across GitHub and professional profiles is slow work. Refolk takes the search as a plain sentence and returns the people, so you can go straight to reading their work.
How to choose between candidate upstream commits and grade identity
Pick the upstream commit that contains the largest share of the copy's distinctive blobs. Then grade the match as exact, patched, closest-commit or unknown, based on how much of the copy matches and whether the leftover difference reads as deliberate local change. No published thresholds exist for these grades, so define your own, write the rule into the record, and apply it the same way every time.
Count distinctive blobs, not all blobs
A distinctive blob is a file content that appears in few origins, so a match on it actually says something about where the copy came from. LICENSE files, empty __init__.py files and stock config files exist in thousands of projects. If you count them, every candidate's match share goes up and the ranking flattens out. Before counting, look up each blob's origins in Software Heritage and drop any that appear across many unrelated projects. Keep a note of what you dropped, because the record should show the denominator you used.
Widen the candidate set before you settle
Start with tags, because a tagged release is the easiest ref to cite. If no tag clearly wins, run the same count over every commit on the default branch, then over other branches. Copies are often taken from an untagged commit between releases. If the best commit still matches poorly, the copy may come from a fork. Go back to the origin lookup and look at the other origins that contain your distinctive blobs.
The four identity grades
- Exact. Every distinctive blob matches one upstream commit and the patch delta is empty. Proves: the copy is that commit's content. Misleads: if you counted common blobs, or if local files were added under the vendored path and never hashed against upstream.
- Patched. One commit wins clearly, and the remaining difference splits into readable local patches. Proves: the base commit, plus a known list of changes. Misleads: when one of those "patches" is actually a later upstream commit pulled in by hand. Check each patch against upstream history.
- Closest-commit. One commit wins, but the remaining difference does not read as deliberate local work. It looks like files from several upstream points, or reformatting. Proves: an approximate base. Misleads: whenever an advisory's fix landed in a file that came from a different upstream point.
- Unknown. No origin found, or candidate commits tie after common blobs are removed. Proves: nothing about the version. Treat any advisory against the suspected origin as potentially applying.
Identity grade from match share and delta shape
A version string tells you what someone meant to copy. A commit hash tells you what they actually copied.
What goes into the pinned record
The record covers one component and carries: a local identity, the upstream as an ancestor with a canonical URL and full commit hash, the patch delta as separate entries, an SPDX license identifier, and the identity grade with its evidence. CycloneDX, SPDX 2.x and OSV each hold part of that, in different places.
| Need | CycloneDX | SPDX 2.x | OSV |
|---|---|---|---|
| Upstream link | pedigree.ancestors | relationship to upstream package | affected[].ranges.repo |
| Patch delta | pedigree.patches.diff | PATCH_FOR / FILE_MODIFIED | n/a |
| Fix evidence | resolves; resolved_with_pedigree | PackageComment | fixed commit |
In CycloneDX, ancestors is the field normally used for forks: the forked component carries an ancestor node that holds the original. patches describe how the component differs from that ancestor. The official pedigree guide's example keeps a local group (com.example) with a repository_url purl qualifier on the component itself, and puts the upstream purl only in the ancestor. A purl (package URL) is the standard string that advisory tools use to identify a package.
Layers of a pinned vendored-component record
- Local identityYour group, name and repository_url, never the upstream purl
- AncestorCanonical upstream URL, ref and full 40-character commit
- PatchesOne diff per local change, each noting what it resolves
- LicenseSPDX license identifier confirmed by legal
- Grade and evidenceIdentity grade, match share, tool name, generation date
{
"type": "library",
"bom-ref": "vendored-foo",
"group": "com.example",
"name": "foo",
"version": "<upstream-ref>-local.1",
"purl": "pkg:<type>/com.example/foo@<upstream-ref>-local.1?repository_url=<your-repo-url>",
"licenses": [{ "license": { "id": "<SPDX-license-id>" } }],
"pedigree": {
"ancestors": [{
"type": "library",
"name": "foo",
"version": "<upstream-ref>",
"purl": "<upstream purl>",
"externalReferences": [{ "type": "vcs", "url": "<canonical upstream URL>" }]
}],
"commits": [{ "uid": "<40-char upstream commit>", "url": "<canonical upstream URL>" }],
"patches": [{
"type": "unofficial",
"diff": { "url": "third_party/foo/patches/0001-<description>.patch" },
"resolves": [{ "type": "security", "id": "<advisory id, only if this patch carries the fix>" }]
}]
},
"properties": [
{ "name": "vendored:identity-grade", "value": "patched" },
{ "name": "vendored:match-share", "value": "<matched distinctive blobs>/<total distinctive blobs>" },
{ "name": "vendored:upstream-swhid", "value": "swh:1:rev:<40-char upstream commit>" },
{ "name": "vendored:path", "value": "third_party/foo" }
]
}Keep your own group and repository_url on the component; the upstream purl appears only inside ancestors. The property names are my convention, so rename them to your house style.
If your pipeline emits SPDX
SPDX 2.x has PATCH_FOR, FILE_MODIFIED and FILE_ADDED relationships. Model the vendored copy as its own package and link it to an upstream package. One practitioner notes that patch metadata is not natively structured at the package level in SPDX, so expect the patch list to end up in relationships and comments rather than a single field. If you are moving to SPDX 3, note that PackageVerificationCode exists there only for 2.x compatibility and its use is discouraged.
When the upstream never released
Pin the commit anyway. CISA's draft Minimum Elements allow a file creation date when a component has no version, and list SWHID and OmniBOR as acceptable software identifiers. A purl convention for release-less upstreams, such as pkg:generic with a vcs_url qualifier, was not verified for this guide. Check the current purl specification before you standardize on it.
How to check an advisory against a vendored copy
Check OSV GIT ranges against the pinned commit using commit-graph reachability, then check the patch list for the fix. A record that holds only a version string cannot be checked against commit ranges at all. That alone is reason enough to pin commits.
OSV is the open vulnerability format used by many advisory databases. For GIT-type ranges, the introduced and fixed values are full-length commit hashes, except for the sentinel introduced: "0", which means the vulnerability goes back to the start of history. Ranges are ordered by reachability in the commit graph, not by version number, so a commit with no tag can still get a clear verdict. Use git merge-base --is-ancestor <event-commit> <pinned-commit> in a clone of the canonical upstream to answer each reachability question.
Advisory verdict for a pinned vendored copy
- PinTake the full 40-character upstream commit from the record
- IntroducedIf the introduced commit is not an ancestor of the pin, not affected
- FixedIf the fixed commit is an ancestor of the pin, not affected
- Patch listIf a local patch carries the fix, mark resolved_with_pedigree
- VerdictOtherwise affected, weighted by the identity grade
CycloneDX 1.7 has an analysis state, resolved_with_pedigree, for fixes evidenced by commits or diffs. That is the correct verdict when the upstream graph says affected but your patch list contains the fix. Weight every verdict by the grade. An exact or patched record supports a confident answer. A closest-commit record means a person has to check the fixed file directly. An unknown record should default to affected until shown otherwise.
One limit: no worked procedure for patched copies has been published beyond the OSV schema's pseudocode. The flow above is my composition of that pseudocode with a patch-list check. Test it against an advisory you already understand before relying on it.
How the origin trace goes wrong
Most failures come from treating a convenience signal as proof: a Linguist flag, a byte-exact hash, a version label, or a tool's "not affected". Each failure mode below comes with the check that catches it.
- Linguist marking taken as an inventory. A path flagged
linguist-vendoredis only excluded from language statistics. Copies without the flag, elsewhere in the tree, are missed. Check: hash every tracked file, not just the flagged paths. - Single re-headed files. Rewriting a license header or changing line endings changes the blob SHA, so the exact lookup fails and the file looks like original code. Check: normalize headers and whitespace on both sides and hash again. For heavily edited files, use snippet scanning.
- Common-file false match. Identical blobs such as LICENSE or an empty
__init__.pyappear in thousands of projects and push the match share up. Check: exclude blobs that appear across many origins in Software Heritage before ranking. - Mislabeled advisory endpoints. OSV conversions for Linux have published release versions as GIT endpoints, which violates the schema and loses the type of the release interval. Check: confirm every GIT endpoint is a 40-character hex string before you trust a reachability result.
- Repo aliases. Mirror URLs produce duplicate and inconsistent ranges for the same upstream. Check: canonicalize the upstream URL in your record, and map advisory repo URLs to that canonical form before comparing.
- Fake upstream version. A patched copy recorded under the upstream purl and version matches advisories it has already fixed, or hides a fix. Check: give it a local identity, set the modified flag where your format version still has one, and always add a pedigree patch list.
- Tooling silently drops GIT ranges. A tool that reads only ECOSYSTEM ranges will report "not affected" for vendored C code. GitHub's innersource advisories, for example, are documented as not processing Git commit-based ranges at all. Check: run the reachability check yourself for any component that has no package ecosystem.
- Keyword noise when staffing the work. "SBOM" matched Snom and SBLM in Refolk's index. Check: require skills or title filters, or describe the work itself in the search. Refolk accepts a plain description such as contributors to CycloneDX tooling, which avoids the acronym collision.
Keeping vendored records current
A pinned record is only correct until someone edits the vendored path. Re-run steps 2 to 5 on every change that touches a vendored directory, and re-run the advisory check whenever a new OSV entry names the canonical upstream. Make the record live next to the code, so that a pull request changing one without the other gets noticed in review.
Three habits keep the work from going stale:
- Gate vendored paths in CI. Fail the build when a file under a recorded component path changes and the record's patch list does not.
- Re-check the regulatory mechanism, not just the date. The CRA dates above are fixed in the text. A trade report says CISA's Minimum Elements guidance was finalized, but that comes from a secondary source only. Check CISA's own publication for which fields are now mandatory.
- Re-measure your own gap. Count confirmed vendored components against manifest-declared ones once a quarter. Your number means more than any published share, because those shares mix in snippets and binaries.
Before calling a component traced
- Every tracked file in the repo has a blob SHA, not only files under flagged vendor paths
- Common blobs were excluded and the denominator of the match share is recorded
- The upstream URL in the record is canonical, not a mirror or fork alias
- The pinned commit is a full 40-character hash that exists in the canonical upstream
- The identity grade is one of exact, patched, closest-commit or unknown, and the grading rule is written down
- Each local change has its own patch file, or the delta is recorded as empty
- The component uses a local identity, and the upstream purl appears only inside pedigree ancestors
- The license is an SPDX identifier confirmed by legal against the upstream at the pinned commit
- The record validates against its CycloneDX or SPDX schema
- Every relevant OSV GIT range has a verdict, with fixes in the patch list marked resolved_with_pedigree
Questions practitioners ask
How do I find the upstream version of vendored code that has no version string?
Hash the files and match the hashes against upstream history. Run git ls-files -s on the copied tree. Look up the blob SHAs as content SWHIDs in Software Heritage to find the origin. Then clone that origin and count how many of the copy's distinctive blobs each tag or commit contains. The commit with the highest count is your closest commit. Record it as a full hash along with the match share, because a version string inside the code may be stale.
What do I do when the vendored copy matches no upstream commit exactly?
Grade it instead of forcing it into a version. Pick the commit with the highest share of matching distinctive blobs and diff the copy against it. If the remaining differences read as deliberate local edits, grade it patched and list those edits as patches. If they look like a mix of upstream commits, grade it closest-commit. If candidates tie or no origin is found, grade it unknown. Treat unknown copies as potentially affected.
Can I just list vendored code in the SBOM under the upstream package name and version?
Not if you have changed it. If a patched copy is recorded under the upstream purl and version, it will match advisories it has already fixed, or it will hide a fix you applied. Give the component a local identity, using your own group and a repository_url qualifier, and put the upstream in pedigree ancestors. Then list each local change under pedigree patches.
Will GitHub's advisory tooling flag vulnerabilities in vendored C code?
Do not assume it will. GitHub's innersource advisory documentation says Git commit-based ranges are not processed. A lot of vendored C and C++ is only described by GIT ranges in OSV, so a tool that reads only ECOSYSTEM ranges can report not affected for code that is affected. Run your own reachability check against the pinned commit for any component that has no package ecosystem.
Why does a file I know was copied not show up in the Software Heritage lookup?
Usually because it is no longer byte-identical to upstream. A rewritten license header, changed line endings or reformatting all change the blob SHA, so an exact lookup misses the file and it looks like original code. Strip the changed header and normalize whitespace, apply exactly the same normalization to the upstream candidate files, then hash both again with git hash-object. For heavily edited files you need snippet-level matching.
What identifier should I record for an upstream that never made a release?
Record the full upstream commit hash as the primary identifier, and add the matching revision SWHID if you can. CISA's draft Minimum Elements list SWHID and OmniBOR as acceptable software identifiers, and allow a file creation date when a component has no version. A purl convention for release-less upstreams, such as pkg:generic with a vcs_url qualifier, was not verified for this guide, so check it with the current purl specification before you standardize on it.
Try it on the search you came here for
Stop building boolean strings. Just describe the person.
Type one sentence. I plan the search, read GitHub, public LinkedIn and Crunchbase records, and the open web as it is right now, and hand back a ranked list with the reason next to every name.
01Describe them
One plain sentence. Role, city, stack, stage, whatever matters to you.
02I read the web live
GitHub, public LinkedIn and Crunchbase records, the open web. Not a database that went stale last quarter.
03You read the shortlist
Ranked, with the reasoning under every name. Open a profile, ask a follow-up, narrow it down.
- Staff backend engineers in NYC who shipped Rust in production
- Series A fintechs in SF under 50 people, growing headcount this year
- Maintainers of fast-growing Rust web frameworks on GitHub
- No boolean, no filters, no seat to buy. One box.
- Read at search time, so a profile updated yesterday counts today.
- Every step visible as it runs, every name with its reason.
500 free credits on sign-up. No card, no demo call. See real searches.