Skip to main content

Malicious code in @ohos-ports/codex (npm)

0
High
Published: 08/05/2026 (08/05/2026, 15:55:39 UTC)
Source: GCVE Database
Product: @ohos-ports/codex

Description

The npm package @ohos-ports/codex version 0.140.0-beta.0 declares a dependency on '@openai/codex' via a mutable tarball URL hosted by a third-party organization not affiliated with the official OpenAI publisher. This setup allows the third party to control the code loaded under the '@openai/codex' namespace, potentially introducing malicious code. Because the dependency is resolved through the dependencies field and not lifecycle scripts, common mitigations like 'npm install --ignore-scripts' do not prevent this behavior. The mutable branch reference means the content can change at any time without republishing the package.

Affected software

npmghsa
@ohos-ports/codex
Affected versions
=0.140.0-beta.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/05/2026, 23:17:42 UTC

Technical Analysis

The @ohos-ports/codex npm package (version 0.140.0-beta.0) includes a dependency on '@openai/codex' that is resolved from a mutable tarball URL hosted by a third-party entity on gitcode.com rather than the official OpenAI source. This dependency resolution method allows the third party to supply arbitrary code under the '@openai/codex' namespace, which is imported and executed by the package's own code. Since the dependency is declared in the dependencies field, typical npm install mitigations such as ignoring lifecycle scripts do not prevent the malicious code from being installed and executed. The mutable reference to the 'main' branch without a fixed commit or integrity hash means the code served can be changed at any time, increasing the risk of supply chain compromise.

Potential Impact

Users installing @ohos-ports/codex version 0.140.0-beta.0 may unknowingly execute malicious code controlled by a third-party organization masquerading as '@openai/codex'. This can lead to arbitrary code execution within the context of the installing environment. The threat arises from the supply chain compromise via a mutable dependency URL, which bypasses common npm security mitigations.

Mitigation Recommendations

No official patch or fix is currently documented for this issue. Users should avoid installing version 0.140.0-beta.0 of @ohos-ports/codex until the dependency on the mutable third-party tarball URL is removed or replaced with a fixed, verified source. Monitoring the vendor or package maintainer advisories for updates is recommended. Since the malicious code is loaded via a dependency URL without integrity verification, users should verify dependencies and avoid packages that rely on mutable external tarball URLs from untrusted sources.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-13210
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a73851fbf8831d5394ef82c

Added to database: 08/05/2026, 18:46:55 UTC

Last enriched: 08/05/2026, 23:17:42 UTC

Last updated: 09/07/2026, 21:54:36 UTC

Views: 18

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses