Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

intset-arena

Latest version: v0.3.1

Overview

Last scanned
14 Aug 2026
Published
13 Aug 2026
npm package Publisher: destbreso
3 Versions
475 Downloads

Scan summary

intset-arena was last scanned on 14 Aug 2026 at version 0.3.1. Risk score 80 of 100 (high). High-severity rules fired.

  • Releases: 3 versions, all published within 5 days (9–13 Aug 2026).
  • Findings: 1 rule fired in version 0.3.1 (1 high). The score describes this version only.
  • Downloads: 475 downloads.

Versions

3 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.1 LATEST 13 Aug 2026 1 rule fired
0.3.0 13 Aug 2026 1 rule fired
0.2.3 9 Aug 2026 Not shown

Rules fired in 0.3.1: 1

Findings

1 High

Findings for v0.3.1. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

Runtime-built function run with Node internals, fed by a network fetch

The code builds a function at runtime and runs it with Node's require, module or process objects, and a network fetch appears to supply the code. Whoever controls the downloaded content could then run code with the same access as the application.

HIGH
Checking access…

🔒 Create a free account to see all 1 finding with descriptions and instance counts

The score describes 0.3.1; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

intset-arena

A benchmark arena for JavaScript integer sets, built around one rule: every memory figure carries the counter that produced it, and figures from different counters are never ranked against each other.

That sounds like bookkeeping. It is the whole package. A sorted Uint32Array, a Set, a native Roaring addon and the same Roaring compiled to wasm keep their bytes in four different places, and no single counter can see all four. Put their numbers in one column and you have invented a ranking: on one workload here, roaring-wasm reads 9,992 bytes against the native roaring build's 43,360, which would make the wasm build four times leaner than the library it is a build of. It is not leaner. One number is what an allocator handed out and the other is what a write to disk would occupy.

So the arena reports four separate tables, each labeled with what its counter measures, and refuses to sort across them.

What this is

If you have not had to choose between integer-set libraries before, here is the situation this exists for.

You have a lot of whole numbers and you need to keep them as a set: ask whether one is present, intersect two of them, count them. Document ids, user ids, row numbers, timestamps. There are at least six reasonable ways to hold that in JavaScript, and they are not variations on a theme. They are genuinely different structures with different costs: a plain Set, a sorted Uint32Array, a flat bitset with one bit per possible value, a compressed bitmap in the Roaring layout, the same Roaring as a native addon, and the same again compiled to WebAssembly.

Which one is right depends on the shape of your numbers, and the ranking flips. Values arriving in long consecutive stretches make a compressed bitmap look magical and a sorted array look absurd. Ten thousand values scattered over a billion invert that completely, and the sorted array wins by a factor of sixty-nine. There is no answer to look up, which is why this is a harness and not a table of results.

A harness is the instrument, not the finding. This package holds the subjects, the workload shapes, the measurement protocol, and the rules about what may be compared with what. You point it at some libraries, including your own, and it produces the table. It has no opinion about which should win, and it deliberately does not ship its author's integer-set library in the default panel: a benchmark whose default configuration includes the benchmark author's product is an advertisement. External subjects enter through a documented door instead, the same one anybody else's package uses.

The hard part turned out not to be timing. It was memory. Asking JavaScript how many bytes a structure occupies is widely treated as unanswerable, and the reframing this is built on is that the question becomes answerable once you stop asking it globally: not "how many bytes", but "how many bytes of which storage class, measured under stated conditions, with the residual error reported". That is the rule at the top of this page, and the next sections are how it is enforced.

Install

npm i -D intset-arena

The subject libraries are optional peers. Install the ones you want measured; an adapter reports itself absent rather than failing the run.

npm i -D roaring roaring-wasm typedfastbitset bitset

Use

npx intset-arena                                     # seven workloads, nine subjects, markdown to stdout
npx intset-arena --memory-only --out report.md
npx intset-arena -w thin/1000/1e9 -p sorted-array -p 'roaring/range-aware'
npx intset-arena --list                              # the vocabulary

A subject is written exactly the way the report prints it, so a row that surprises you pastes straight back in as an argument.

import { renderReport, run, uniform } from "intset-arena";

const reports = await run({
  workloads: [uniform(100_000, 10_000_000)],
  panel: [{ id: "sorted-array" }, { id: "roaring", insertion: "range-aware" }],
  ops: ["and", "or"],
});
console.log(renderReport(reports));

Measuring memory in JavaScript

The usual claim is that you cannot. You can, per storage class, and only when three preconditions hold at once:

  1. no live reference to the subject in the measuring frame,
  2. a settled collector,
  3. the counter matched to where the bytes actually live.

Violating any one of them produces the same symptom, a number that looks unreliable, which is why the exercise gets written off. A sweep that read 0.667, 0.700, 0.900, 0.967 and 0.990 of ground truth looks exactly like a flaky counter. It was one stale reference in a stack slot of the measuring frame, a constant deficit at every size. Move the allocation into a callee frame and the same sweep reads 1.000000 every time, integer-equal from 25 KB to 2.5 GB.

The counters are not interchangeable, and two independent properties decide what each one is good for:

counter storage class live bytes? exact?
array-buffers typed array yes yes, to the byte
heap-used JS heap yes to a fraction of a percent
heap-and-buffers mixed yes no better than its coarser half
own-counter native addon yes quantized to capacity steps
serialized-size wasm no, a different quantity reproducible
reserved-upper-bound wasm no, reserved pages drifts

Those two questions came apart the hard way. A single isExact flag was doing both jobs and got both wrong in opposite directions: it called heap-used not-live-bytes, which is false with a settled collector, and it called own-counter exact, which is false because the same 37,792 bytes covers everything from 20 to 30 members per container.

The heap counter cannot tell a set apart from the code that builds it. The first call through a build path compiles it, installs its inline caches and creates its hidden classes, all of which land on the heap and survive a collection, so the counter charges them to the subject. Measured: the same million-value set read 94,536 bytes on the first build in a process and 1,992 on the second. Every heap-based reading here is therefore taken after one full build that is thrown away, and a cheap warm-up is not a substitute, since a thousand-value sample through the same path recovered only 40% of it and never reaches the code that converts a container to its dense form.

That cost is fixed, which is what let it hide. On one fixture it was 11,928 bytes at 40, 100 and 400 blocks alike: 2.46x the true figure for the smallest set and 1.01x for the largest. A benchmark carrying it does not misreport uniformly, it slanders whichever subject is holding the least, which in a compressed-set arena is the subject that is winning.

Counters are process-wide, so exactness is a property of an isolated process, not of the counter. The same dense bitset that reads integer-exact in a quiet process reads 169 bytes over inside a test runner, with the runner idle. Each measurement here therefore gets its own forked child: one subject, one workload, one reading. A tolerance would paper over that, and a tolerance wide enough to absorb a noisy runner is also wide enough to absorb the uncollected-orphan bug the protocol exists to catch.

There is no live-bytes instrument for wasm linear memory at all. roaring-wasm reserves its pool at module init and does not grow it, so the delta reads 0 for a bitmap that serializes to 131 KB, which prints as "free" and is worse than admitting the instrument does not exist. Those rows report serialized size, in their own group, labeled as the lower bound it is.

heap-and-buffers is the one sum this package permits, and the exception needs justifying rather than assuming, since refusing to add counters is most of what the rest of this page is about. A pure-JavaScript container model keeps its payload in typed arrays and its per-container bookkeeping in ordinary objects, so neither counter alone sees the set. Those two count disjoint regions, read as deltas across the same settled window in the same process, which is what makes the total a measurement of one thing rather than a ranking assembled from two. It is still not exact, because a sum is only as resolvable as its coarser term.

Filing such a subject under one counter anyway does not give a rough number, it gives a confident wrong one. Ten thousand values spread over a billion land in ten thousand blocks of one or two members each; V8 keeps a small typed array's 216-byte wrapper on the heap and allocates no external backing store worth counting, so arrayBuffers reports zero for a set that costs 2.25 MB. A panel printing that would hand the crown to whichever subject allocates where its assigned counter cannot look.

What the shapes do to the answer

The axis that decides everything is not sparsity, it is members per container: how many fall inside one aligned 65,536-wide block. Two workloads with the same member count over the same universe land on opposite sides of both representation thresholds, which is why "sparse" specifies nothing.

Measured on an Apple M4, Node 22.14, roaring 2.7.0, roaring-wasm 1.1.0, typedfastbitset 0.8.0, bitset 5.2.3. Excerpted from the tool's own output, which means grouped by counter and ranked only inside a group. The three roaring insertion variants read identically on both of these shapes and collapse to one row.

That run is committed at docs/REPORT.md and ships in the tarball, so every memory figure on this page has a run behind it that you can read. intset-arena --memory-only --out docs/REPORT.md regenerates it, and npm run verify:claims walks the memory rows of this README and fails if the report disagrees with any of them.

1,000 members over a universe of a billion, about one per container:

subject bytes counter
sorted Uint32Array 4,000 array-buffers
SparseTypedFastBitSet 128,209,704 array-buffers
typedfastbitset 189,646,168 array-buffers
Set 20,640 heap-used
bitset 343,703,792 heap-used
roaring 43,360 own-counter, payload alone 2,000
roaring-wasm 9,992 serialized-size, a different quantity

500,010 members over a universe of a million, half of everything:

subject bytes counter vs information floor
SparseTypedFastBitSet 139,256 array-buffers 1.11x
typedfastbitset 163,832 array-buffers 1.31x
sorted Uint32Array 2,000,040 array-buffers 16.00x
bitset 349,504 heap-used 2.80x
Set 10,485,920 heap-used 83.89x
roaring 131,824 own-counter 1.05x

The same subjects, and everything about the answer changes: five orders of magnitude of spread on the first shape, less than two on the second, and a different representation in front.

One panel per counter, sharing a log scale so the shapes can be read against each other without any line implying a ranking across a panel boundary. The crossing in the top panel is the whole argument: a sorted Uint32Array starts five orders of magnitude below the dense bitsets and ends above them.

When not to use a compressed bitmap

Both ends are real and the arena is built to show them.

Below about 23 members per container, a sorted Uint32Array wins. At one member per container the array holds 1,000 members in 4,000 bytes. Roaring's own containers hold the same members in 2,000, and yet holding the bitmap costs the process 43,360, because at that shape the bookkeeping around the members dwarfs the members: 998 containers, each with a descriptive header, an offset and its own allocation. Even its portable serialization, which is the closest thing to a like-for-like figure, is 9,992.

Read those three numbers carefully, because they come from different counters and that is the point rather than a caveat. 4,000 is exact and is what the buffer requested. 43,360 is what a native allocator handed out, which includes slack the typed array also pays and no V8 counter can see. Comparing them is fair only in the sense that a factor of ten survives any accounting boundary you pick; a factor of two would not, and the arena will not print one.

The crossover is measured rather than asserted: sweeping members per container with the container count fixed, roaring's allocator delta crosses below the array's 4n between 22 and 24. A least-squares fit of the per-container overhead said 21.6 and was wrong, because the allocator moves in capacity steps, so the cost is a staircase and not a line.

Speed at that shape agrees and is measured on one clock for everyone: intersection takes 3.8 microseconds for the array against roaring's 77. Union does not agree, which is worth knowing before generalizing: the array's merge allocates the entire result, so it takes 333 microseconds where roaring-wasm takes 22.

Read the timing rows with a hand on the brake, though. The memory axis is exact and the clock is an estimate, and an estimate needs an apparatus the exact side does not. Each timing here is the median of interleaved rounds in each of five separate processes, and two subjects are ranked only when all five agreed on the direction. That rule is not ceremony: across the panel in docs/REPORT.md it leaves 22 pairs unordered, and the widest of them sits at a median ratio of 1.30x. Ranking on the medians alone would have published every one of those as a result. Timings also stay comparable inside their own table and nowhere else, since arms are interleaved within a race and not across races.

At high density over a bounded universe the compression stops buying anything. At 50% of a million, roaring, SparseTypedFastBitSet and typedfastbitset sit between 1.05x and 1.31x of the information floor. They have converged on storing one bit per value, and roaring is a bitmap container with extra bookkeeping. Pick on simplicity, not on bytes.

When not to use the arena

The memory protocol is why this package exists and it is not free: a fork per subject per workload, a settled collector around every reading, and a vocabulary of counters to learn before a table means anything. Three cases where you should not pay for it.

You only need timing. tinybench, mitata and benchmark (Benchmark.js) are general-purpose runners that will time any function you hand them, and none of them asks you where your bytes live. Use one of those and keep the one rule that is not optional: consume every result into a sink the engine cannot prove unused, or you are timing a deleted call.

Your question is about the process and not about one structure. This measures one subject in one child on purpose, so it cannot tell you what your application holds. v8.writeHeapSnapshot() from node:v8 and the DevTools heap profiler answer that question, and v8.getHeapStatistics() is the cheap version of it.

You are not choosing between libraries. If the shape of your data is fixed and you already know your members per container, the sections above say which side of the crossover you are on, and running the panel will tell you the same thing more slowly.

The insertion path is a two-order-of-magnitude decision

The largest single effect measured here is not between libraries. It is inside one.

Clustered data, 949,124 members in contiguous blocks:

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm intset-arena

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229