Hex.pm, the official package registry for the Elixir and Erlang ecosystems, has confirmed that attackers executed commands on six of its web servers on November 23. The incident also exposed a remote code execution (RCE) flaw rated CVSS 10.0 that had been present since 2016. The Hex team says it blocked the traffic and deployed a fix within roughly 20 minutes.

What Happened

Hex.pm serves as the central repository for Elixir and Erlang packages, which developers download as dependencies via the mix command — functionally the equivalent of npm for Node.js or PyPI for Python. Attackers achieved command execution on six of its web servers; after detecting anomalous traffic, the Hex team moved to block it and patch the vulnerability. The flaw itself, however, is not a new discovery: its origins trace back to 2016, meaning it had been sitting inside the registry's infrastructure for nearly a decade.

Hex has emphasised that it blocked the attack traffic and shipped a fix, while also acknowledging that data theft cannot be ruled out — this is a potential risk, not a confirmed exfiltration. On that basis, the project has asked all users to reset their passwords.

Analysis

The following reflects this publication's reading of the incident and is not drawn from the source report.

An RCE on a registry is trickier than a typical web-app RCE, and the reason is positioning: it sits upstream of the build pipeline, so the blast radius extends not to the registry's own users but to every downstream project pulling packages from it.

For the developer community, the cautionary value here lies in the sharp contrast between response speed and vulnerability age — the team reacted swiftly once anomalies were flagged, yet the flaw itself had persisted for nearly a decade, upstream of the software supply chain. Any attacker able to run arbitrary commands on such a registry could, in principle, tamper with packages referenced by tens of thousands of projects. That is the canonical supply-chain attack path: rather than breaching the final application, corrupt the source of its dependencies.

This is not an Elixir-specific case. Every package registry that development teams rely on daily — npm, PyPI, RubyGems, crates.io — carries the same structural risk: they function as a shared trust root for many projects at once, and once compromised, the impact extends well beyond any single organisation's boundary. For Hong Kong development teams, the question worth examining is not whether you use Elixir, but whether each registry you depend on offers a public security-advisory mechanism, whether lockfiles and integrity hashes are enabled as a matter of course, and whether, when something goes wrong upstream, you can quickly identify which dependency versions are affected. This is a shared concern for the entire open-source toolchain, not a matter for any single language community.

Recommendations

Hex has explicitly asked all users to reset their passwords. The steps below are this publication's own guidance for readers:

  • Reset your password: Especially if the password tied to your Hex.pm account has been reused elsewhere, replace it across all services and enable two-factor authentication (2FA).
  • Review API keys and access tokens: Check whether Hex API keys in personal accounts or CI environments need to be rotated.
  • Audit dependency status: Confirm that package versions and their sources in your project lockfiles look correct, and watch for follow-up security advisories from the registry.
  • Use this as a trigger for a supply-chain incident drill: Establish how long your team's detection, notification, and package-update workflow would take to complete once an upstream registry announces an incident.

Teams bound by any incident-reporting or contractual obligations should assess whether this event falls within their reporting scope.

(Source: Security Affairs, "Hex.pm Attack Exposes a Flaw Dating Back to 2016")


Elixir 與 Erlang 生態系的官方套件 registry Hex.pm 證實,攻擊者於 11 月 23 日在其六台 web server 上執行了命令。事件同時暴露了一個自 2016 年起就存在、評分為 CVSS 10.0 的遠端程式碼執行(RCE)漏洞。Hex 團隊表示已攔截相關流量,並在約 20 分鐘內部署修復。

發生了什麼

Hex.pm 是 Elixir 與 Erlang 套件的中央 repository,開發者透過 mix 指令從中下載依賴項,功能上類似 Node.js 的 npm 或 Python 的 PyPI。攻擊者在其六台 web server 上取得了命令執行能力;Hex 團隊偵測到異常流量後隨即予以攔截並修補漏洞。然而漏洞本身並非新發現:其根源可追溯至 2016 年,亦即在這套 registry 的基礎設施中潛伏了近十年。

Hex 強調已攔截攻擊流量並推出修復,同時坦承資料外洩(data theft)的可能性無法排除——這是潛在風險,而非已確認的外洩。基於此,官方已要求所有使用者重設密碼。

分析

以下為本刊就事件本身所作的解讀,並非來源報導內容。

一個 registry 的 RCE 比典型的網頁應用 RCE 更棘手,關鍵在於位置:它坐落在建置管線的上游,爆炸半徑並非 registry 本身的使用者,而是所有從中拉取套件的下游專案。

對開發者社群而言,此案的警示在於應對速度與漏洞年齡之間的強烈反差——團隊在偵測到異常後迅速反應,但漏洞本身已存在近十年,且位於軟體供應鏈的上游。任何能在此類 registry 執行任意命令的攻擊者,理論上都有機會污染被數以萬計專案引用的套件。這正是供應鏈攻擊最典型的路徑:不直接攻破最終應用程式,而是污染其依賴來源。

這並非 Elixir 生態系的特例。任何開發團隊日常依賴的套件 registry——無論是 npm、PyPI、RubyGems 還是 crates.io——都具有相同的結構性風險:它們是眾多專案共同的信任根(trust root),一旦被攻破,影響範圍遠超單一組織的邊界。對香港開發團隊而言,值得檢視的不只是是否使用 Elixir,而是所依賴的各個 registry 是否設有公開的安全公告機制、lockfile 與完整性雜湊(integrity hash)是否常態啟用,以及一旦上游出事,自身能否迅速辨識受影響的依賴版本。這是整個開源工具鏈的共同課題,而非某個語言社群的私事。

建議

Hex 已明確要求所有使用者重設密碼。以下步驟為本刊整理的後續建議,供讀者參考:

  • 重設密碼:尤其是與 Hex.pm 帳號綁定、且在其他服務重複使用的密碼,應一併更換並啟用雙重認證(2FA)。
  • 審視 API key 與 access token:檢查個人帳號或 CI 環境中的 Hex API key 是否需要輪替(rotate)。
  • 檢查依賴狀態:確認專案 lockfile 中的套件版本與其來源是否正確,並留意 registry 後續發布的安全公告。
  • 將此案作為供應鏈事故演練的觸發點:釐清一旦上游 registry 宣布事故,團隊的偵測、通報與套件更新流程需要多久才能完成。

自身受制於任何事故通報或合約義務的團隊,應評估此事件是否落入其通報範圍。

(資料來源:Security Affairs,"Hex.pm Attack Exposes a Flaw Dating Back to 2016")

新聞來源 / Original News Source