Skip to content

chore: sync upstream changes (d3f79f40) - #189

Merged
willdurand merged 9 commits into
amofrom
sync/upstream-d3f79f40
Dec 2, 2026
Merged

willdurand merged 9 commits into
amofrom
sync/upstream-d3f79f40

Conversation

@github-actions

@github-actions github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

This PR brings in the latest changes from VirusTotal/yara-x.

Commits included

d3f79f40 fix(compiler): prevent include errors from leaking outside path existence
2ad57461 fix(modules): store memoized module state per scan in ScanContext
15034075 fix(authenticode): ignore unsupported attribute OIDs and bad countersignatures
5f19c5a7 fix(scanner): merge overlapping snippet ranges in block scanner
47d63c45 docs(cuckoo): add the reference page for the cuckoo module (#926)
d27f0d6d chore(deps): bump glob and @vscode/vsce in /ls/editors/code (#927)
1c3225e5 docs(capi): update comment for `yrx_rules_deserialize`.
de91ce80 fix(dotnet): make type plain_name and NestedClass lookups O(1)

Generated automatically by the Sync Upstream workflow.

plusvic and others added 9 commits December 1, 2026 10:31
TypeRef::plain_name and TypeDef::plain_name previously ran rsplit_once on every mention of a type in a signature to strip the generic arity suffix, and write_type_full_name scanned the entire NestedClass table linearly for every nested-type mention. Through shared TypeSpec blobs with empty formatted prefixes, small .NET files stayed under MAX_TYPE_NAME_LEN and MAX_METHOD_SIG_BYTES while repeating millions of linear scans inside the module parser, stalling scans far past Scanner::set_timeout.

Precompute plain_name once per TypeRef and TypeDef row during table parsing and lazily index NestedClass into a OnceCell<Vec<Option<usize>>> mapping each TypeDef to its first non-self-referential enclosing class. Preserve identical output and add unit tests covering both lookups.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-L7H4TNUR
Removes [glob](https://github.com/isaacs/node-glob). It's no longer used
after updating ancestor dependency
[@vscode/vsce](https://github.com/Microsoft/vsce). These dependencies
need to be updated together.

Removes `glob`

Updates `@vscode/vsce` from 3.9.2 to 4.1.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/Microsoft/vsce/releases">@​vscode/vsce's
releases</a>.</em></p>
<blockquote>
<h2>v4.1.1</h2>
<h2>Changes:</h2>
<ul>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1355">#1355</a>:
chore: bump vscode/vsce-sign</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1347">#1347</a>:
chore(deps-dev): bump serialize-javascript from 7.1.2 to 7.1.4</li>
</ul>
<p>This list of changes was <a
href="https://dev.azure.com/monacotools/Monaco/_build/results?buildId=496280&amp;view=logs">auto
generated</a>.</p>
<h2>v4.1.1-1</h2>
<h2>Changes:</h2>
<ul>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1355">#1355</a>:
chore: bump vscode/vsce-sign</li>
</ul>
<p>This list of changes was <a
href="https://dev.azure.com/monacotools/Monaco/_build/results?buildId=496253&amp;view=logs">auto
generated</a>.</p>
<h2>v4.1.1-0</h2>
<h2>Changes:</h2>
<ul>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1347">#1347</a>:
chore(deps-dev): bump serialize-javascript from 7.1.2 to 7.1.4</li>
</ul>
<p>This list of changes was <a
href="https://dev.azure.com/monacotools/Monaco/_build/results?buildId=491411&amp;view=logs">auto
generated</a>.</p>
<h2>v4.1.0</h2>
<h2>Changes:</h2>
<ul>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1348">#1348</a>:
cli: Show OIDC publishing in help</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1346">#1346</a>:
Set npm minimum release age and apply audit fixes</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1345">#1345</a>:
publish: send X-Market-CI-Provider header with Marketplace requests</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1342">#1342</a>:
chore(deps): bump actions/setup-node from 7.0.0 to 7.1.0 in the
github-actions group</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1335">#1335</a>:
chore(deps-dev): bump fast-uri from 3.1.6 to 3.1.8</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1338">#1338</a>:
chore(deps): bump brace-expansion</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1337">#1337</a>:
oidc: align token exchange with the Marketplace contract</li>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1332">#1332</a>:
Update qs transitive dependency to 6.16.0</li>
</ul>
<p>This list of changes was <a
href="https://dev.azure.com/monacotools/Monaco/_build/results?buildId=490173&amp;view=logs">auto
generated</a>.</p>
<h2>v4.0.1-6</h2>
<h2>Changes:</h2>
<ul>
<li><a
href="https://redirect.github.com/Microsoft/vsce/issues/1348">#1348</a>:
cli: Show OIDC publishing in help</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/3f34096317748bf777ac84c23a7205a74ba29d39"><code>3f34096</code></a>
chore: bump vscode/vsce-sign (<a
href="https://redirect.github.com/Microsoft/vsce/issues/1355">#1355</a>)</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/5df41fb70298d80024d7ea34b1e3b82bec830f4b"><code>5df41fb</code></a>
chore: npm audit fix</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/6a6356e77f270b4784a7d204a5880d52c8b7fa97"><code>6a6356e</code></a>
chore: bump vscode/vsce-sign</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/d332cba2a2345122b3e0b0e752c7511622e84dc0"><code>d332cba</code></a>
chore(deps-dev): bump serialize-javascript from 7.1.2 to 7.1.4 (<a
href="https://redirect.github.com/Microsoft/vsce/issues/1347">#1347</a>)</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/33c66df49adc5e4455797e2f2174ac9838c34866"><code>33c66df</code></a>
Show OIDC publishing in help (<a
href="https://redirect.github.com/Microsoft/vsce/issues/1348">#1348</a>)</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/cc5321a01e285784714424a96cf025e459a89bf8"><code>cc5321a</code></a>
Set npm minimum release age and apply audit fixes (<a
href="https://redirect.github.com/Microsoft/vsce/issues/1346">#1346</a>)</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/402a12c984d4875cc0ca6be1590f7a20d497ec44"><code>402a12c</code></a>
Merge pull request <a
href="https://redirect.github.com/Microsoft/vsce/issues/1345">#1345</a>
from microsoft/benibenj/agents/ci-provider-header-lo...</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/b84c66541259c04c4b8b8f4d70562e5894b1ee03"><code>b84c665</code></a>
Send CI provider header with Marketplace requests</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/aeed595b5c13d6ee6eaeb5eef7856de31085e8ac"><code>aeed595</code></a>
chore(deps): bump actions/setup-node (<a
href="https://redirect.github.com/Microsoft/vsce/issues/1342">#1342</a>)</li>
<li><a
href="https://github.com/microsoft/vscode-vsce/commit/04811a94ac8d7cc4d2c2b61c568b065467d39025"><code>04811a9</code></a>
chore(deps-dev): bump fast-uri from 3.1.6 to 3.1.8 (<a
href="https://redirect.github.com/Microsoft/vsce/issues/1335">#1335</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/Microsoft/vsce/compare/v3.9.2...v4.1.1">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/VirusTotal/yara-x/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
The cuckoo module is enabled by default but has no page under
site/content/docs/modules/. This adds one, in the same format as the
other module pages.

The page explains how the Cuckoo report is passed to the module (`yr
scan -x cuckoo=report.json` and `ScanOptions.set_module_metadata` in
Python), and documents the 11 functions with an example for each.

I checked every example with the yara-x 1.25.0 Python package against
the reports in lib/src/modules/cuckoo/tests/testdata. The reports there
have no POST request, so I checked `network.http_post` with a small
hand-written report.

Two things I'd like you to confirm:

1. The functions return the number of matching entries, not a boolean,
so `cuckoo.network.udp(/10\.0\.2\./, 68) == 2` works on 1.json. The page
documents this. If you'd rather not commit to the count, I can reword it
to only describe the boolean use.

2. The doc comment of `network.host` in mod.rs says it checks the HTTP
Host header, but the function reads the `network.hosts` list, which
holds IP addresses in Cuckoo reports (the test rule passes
`/65.55.56.206/`, and `/checkip/` doesn't match 2.json even though it is
the Host header there). The page describes what the code does. I can
also fix the comment in this PR if you want.
blocks::Scanner::scan previously copied the bytes (plus context) of each match in a block into its own Vec keyed by start offset. Patterns with large jumps (e.g. { 4D 5A [0-] 50 45 00 00 }) can produce O(N) overlapping matches ending at the same tail, causing O(N^2) memory usage for a single block regardless of scan timeout.

Expand, sort, and merge overlapping or adjacent block-relative ranges in place inside block_matches before copying snippets so each byte of a scanned block is retained at most once. This also avoids truncating an earlier match's left context when nearby matches overlap in the same block.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-0HPO42DS
…ignatures

Attribute::parse previously turned any valid ASN.1 OID unsupported by const_oid (such as second arcs >= 40 under root arc 2, UUID-based arcs under 2.25, or encodings longer than 39 bytes) into a parse error, discarding the entire SignerInfo. Likewise, parse_content_info propagated errors from Microsoft and PKCS#9 countersignatures lacking messageDigest. Because unsigned attributes are not covered by the signature, appending a single such attribute hid a valid PE or MSI signature without a key.

Return Option<Attribute> from Attribute::parse so well-formed attributes with unrepresentable OIDs are skipped while malformed DER remains an error (signed attribute verification hashes raw_signed_attrs and is unaffected), and skip unparseable countersignatures instead of rejecting the primary signature.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-7AUFABJO
Memoized function results in pe, elf, macho, dex, crx, hash, magic, and math, along with the parsed report in cuckoo, were stored in thread-locals cleared only by each module's main function. When main is skipped (Scanner::set_module_output or blocks::Scanner), scans returned stale values computed for earlier files on the same thread, including across scanners and rule sets.

Add a type-indexed ModuleState owned by ScanContext and cleared in ScanContext::reset(), transfer state written through ModuleContext in scan_impl, and migrate all nine modules off thread-locals (leaving only magic's loaded libmagic database handle).

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-7MYGXCUY
…ence

Compiler::read_included_file previously returned raw canonicalize() errors before checking whether the path was inside an include root, so probing paths outside the configured include directories (e.g. /etc/passwd/x, unsearchable directories, symlink loops, or overly long names) produced E042 with OS error text instead of E043. It also checked only the final canonicalized path, letting ../outside/../rules/ok.yar act as a directory existence oracle.

Map all canonicalization and out-of-root failures to NotFound (E043) while keeping detailed E042 errors for files verified to be inside an include root, and verify that every .. component (outside an immediate run of ..) starts from a directory resolving inside an include root.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-1LMHL54J
@willdurand
willdurand marked this pull request as ready for review December 2, 2026 09:01
@willdurand
willdurand merged commit 491da49 into amo Dec 2, 2026
6 checks passed
@willdurand
willdurand deleted the sync/upstream-d3f79f40 branch December 2, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants