Skip to content

The attacker model defines the minimum timing difference (threshold θ) that counts as a security-relevant leak. There’s no single correct threshold; your choice is a statement about your threat model.

A 50ns timing difference might be completely unexploitable for an internet-facing API, but a serious vulnerability for code running in an SGX enclave. The attacker model captures this context.

PresetθUse caseNotable vulnerabilities
SharedHardware0.6ns (~2 cycles)SGX, cross-VM, containersSpectre, Meltdown, cache attacks
PostQuantum3.3ns (~10 cycles)Post-quantum cryptoKyberSlash
AdjacentNetwork100nsLAN, HTTP/2 APIsLucky Thirteen, ROBOT
RemoteNetwork50μsInternet-facingBleichenbacher, Marvin Attack
Research0Profiling onlyN/A
Is your code running in SGX, containers, or VMs
where an attacker could be co-resident?
├── Yes → SharedHardware (0.6ns)
│ (if achievable on your platform)
└── No
Are you building a cryptographic library?
├── Yes → SharedHardware (0.6ns)
│ (users may deploy in any context)
└── No
Does your API use HTTP/2, HTTP/3, or gRPC?
├── Yes → AdjacentNetwork (100ns)
└── No
Is the service on a private LAN?
├── Yes → AdjacentNetwork (100ns)
└── No → RemoteNetwork (50μs)

Use when an attacker has co-resident access to your hardware:

  • SGX enclaves: Host OS can measure enclave timing at cycle granularity
  • Cross-VM attacks: Attacker VM on same physical host
  • Container isolation: Adjacent containers share CPU caches
  • Hyperthreading: Attacker on sibling logical core

At this threshold, even 1-2 CPU cycles of timing variation is considered a leak.

Famous vulnerabilities exploitable at this level:

  • Spectre and Meltdown relied on cycle-level timing
  • Cache timing attacks on AES T-tables (Bernstein 2005)
  • SGX side-channel attacks (Van Bulck et al. 2018)

Use when the attacker is on the local network or uses request multiplexing:

  • LAN attacker: Same network segment, minimal latency
  • HTTP/2 and HTTP/3 APIs: Timeless Timing Attacks enable precise timing even from the internet
  • gRPC and internal microservices: Low-latency service-to-service calls

Famous vulnerabilities exploitable at this level:

  • Lucky Thirteen: 100-200ns TLS CBC padding oracle
  • ROBOT: RSA padding oracle on TLS servers
  • HTTP/2 multiplexing attacks (Van Goethem et al. 2020)

Use when the attacker measures timing over the general internet:

  • Legacy HTTP/1.1 services: No request multiplexing
  • Public APIs: General internet exposure with variable latency
  • Traditional protocols: Email, FTP, SSH

Famous vulnerabilities exploitable at this level:

  • Bleichenbacher’s attack: Original RSA PKCS#1 padding oracle (1998)
  • Marvin Attack (CVE-2023-49092): RSA timing leak in multiple TLS libraries
  • Original OpenSSL RSA timing attack (Brumley & Boneh 2003)

Use for debugging and profiling only. Detects any statistical timing difference, no matter how small.

The relationship between timing difference and attack feasibility, based on Crosby et al. (2009):

Timing differenceApproximate queries neededAttack scenario
1-10ns~1,000Same physical core (SGX, hyperthreading)
10-100ns~10,000-100,000HTTP/2 multiplexing, LAN
100ns-10μs~1,000-10,000Network timing with averaging
10-50μs~100-1,000Standard internet timing
> 50μs< 100Trivially exploitable

When presets don’t fit your requirements, use a custom threshold:

TimingOracle::for_attacker(AttackerModel::Custom { threshold_ns: 500.0 })

See Code examples below for other languages.

The key constraint: your threshold must be above your measurement floor. Otherwise, results will be inconclusive.

Workflow:

  1. Run with Research mode to characterize the effect and see your measurement floor
  2. Set your threshold above the floor (if floor is 21ns, use 25ns or higher)
  3. Consider your threat model (exploitability, not just measurability)
ThresholdUse case
10ns”Realistic shared hardware” when 0.6ns isn’t achievable
25-50nsStrict testing on ARM64 without cycle-accurate timing
500nsConservative margin for network services
1μs-10μsPermissive, for high-latency environments

If you request a threshold below your measurement floor, the library automatically elevates it to an achievable value.

For example:

  • You request SharedHardware (0.6ns)
  • Your measurement floor is 21ns
  • The effective threshold becomes 21ns

When this happens, results tell you whether there’s a leak above 21ns, not 0.6ns. Check theta_eff vs theta_user in diagnostics to see if elevation occurred.

See Measurement Precision for details on improving precision and understanding platform limits.

Basic usage for each language:

use tacet::{TimingOracle, AttackerModel};
// Preset
TimingOracle::for_attacker(AttackerModel::AdjacentNetwork)
// Custom threshold
TimingOracle::for_attacker(AttackerModel::Custom { threshold_ns: 500.0 })
  • Choose an attacker model that matches your deployment’s threat model
  • AdjacentNetwork is a good default for most network services
  • SharedHardware for cryptographic libraries or SGX/container deployments
  • SharedHardware requires cycle-accurate timing (see Measurement Precision)
  • Use custom thresholds when presets don’t fit
  • Your threshold must be above your measurement floor

The threshold values and exploitability estimates are based on published research: