Threat Model Overview

May 10, 2026 ยท View on GitHub

This document describes the threat modelling approach for the Hex package ecosystem.

Scope

This threat model covers:

  • hex.pm - The package registry API and web interface
  • hexdocs.pm - Documentation hosting
  • repo.hex.pm - Package artifact and registry storage
  • Hex clients - Mix, Rebar3, and Gleam build tool integrations

Methodology

This threat model uses a hybrid approach:

  1. Asset-based analysis - Identify what we protect
  2. Actor-based analysis - Identify who interacts with the system
  3. Trust boundary analysis - Identify where trust changes
  4. Threat enumeration - Identify what can go wrong

Framework Alignment

This threat model draws from established supply chain security frameworks:

FrameworkFocusReference
ENISAPackage manager security risksTechnical Advisory for Secure Use of Package Managers
OpenSSFRepository security principlesPrinciples for Package Repository Security
OWASPApplication security risksTop 10:2025 A03 - Software Supply Chain Failures
NIST SSDFSecure development practicesSP 800-218
SLSASupply chain integrity levelsSLSA Specification

Threat Summary

IDThreatLikelihoodImpactRisk
T1Malicious publicationMediumCriticalHigh
T2TyposquattingMediumHighMedium
T3Package tamperingLowCriticalMedium
T4Account takeoverMediumHighHigh
T5Documentation attacksLowMediumLow
T6Registry compromiseLowCriticalMedium
T7Denial of serviceMediumMediumMedium
T8Vulnerable dependenciesHighVariableHigh
T9Unmaintained packagesHighMediumMedium
T10Build pipeline compromiseLowCriticalMedium

See Threats for detailed descriptions.

Document Structure

DocumentPurpose
ArchitectureSystem overview and trust boundaries
AssetsWhat we protect
ActorsLegitimate users and adversaries
ThreatsKey threats to the ecosystem
MitigationsHow threats are addressed
AssumptionsWhat we assume and don't guarantee

Hex-Specific Considerations

Registry Role

Hex.pm is the distribution point, not the build system. This means:

  • Limited control over T10: Build happens on maintainer machines
  • Strong control over T3: Registry signing and checksums provide tamper evidence
  • Shared responsibility for T1/T4: Authentication controls, but maintainers control their credentials

Elixir/Erlang Ecosystem Factors

  • BEAM immutability: Less attack surface than native code execution
  • Smaller ecosystem: Fewer packages means potentially less noise for detection
  • Active community: Strong review culture in Elixir community

Maintenance

This threat model is a living document. It should be reviewed:

  • When significant features are added
  • When new threat vectors are identified
  • Periodically (at least annually)