惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
J
Java Code Geeks
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Last Week in AI
Last Week in AI
雷峰网
雷峰网
博客园_首页
小众软件
小众软件
美团技术团队
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
腾讯CDC
P
Proofpoint News Feed
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
U
Unit 42
The Cloudflare Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
N
Netflix TechBlog - Medium
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 叶小钗

Aikido Security's Blog

Axios CVE-2026-40175: a critical bug that’s… not exploitable GlassWorm goes native: New Zig dropper infects every IDE on your machine Aikido Attack finds multiple 0-days in Hoppscotch The cybersecurity doomerism around Mythos doesn't match what we see on the ground axios compromised on npm: maintainer account hijacked, RAT deployed Popular telnyx package compromised on PyPI by TeamPCP Aikido × Lovable: Vibe, Fix, Ship CanisterWorm Gets Teeth: TeamPCP's Kubernetes Wiper Targets Iran TeamPCP deploys CanisterWorm on NPM following Trivy compromise Security testing is validating software that no longer exists Aikido Recognized by Frost & Sullivan with the 2026 Customer Value Leadership Award in ASPM GlassWorm Hides a RAT Inside a Malicious Chrome Extension fast-draft Open VSX Extension Compromised by BlokTrooper Glassworm Strikes Popular React Native Phone Number Packages Glassworm Is Back: A New Wave of Invisible Unicode Attacks Hits Hundreds of Repositories How Security Teams Fight Back Against AI-Powered Hackers Introducing Betterleaks, an open source secrets scanner by the author of Gitleaks Trump’s 2026 cybersecurity strategy: From compliance to consequence How does AI pentesting work with compliance? What continuous pentesting actually requires Rare Not Random: Using Token Efficiency for Secrets Scanning Persistent XSS/RCE using WebSockets in Storybook’s dev server Why Determinism Is Still a Necessity in Security WAF vs. RASP vs. ADR Introducing Aikido Infinite: A new model of self-securing software How Aikido secures AI pentesting agents by design Astro Full-Read SSRF via Host Header Injection How to Get Your Board to Care About Security (Before a Breach Forces the Issue) What is Slopsquatting? The AI Package Hallucination Attack Already Happening SvelteSpill: A Cache Deception Bug in SvelteKit + Vercel
npm backdoor lets hackers hijack gambling outcomes
Ilyas Makari · 2026-02-16 · via Aikido Security's Blog

Our malware detection pipelines recently lit up on a small cluster of packages on npm that looked... familiar.

Packages like json-bigint-extend, jsonfx, and jsonfb were mimicking the popular json-bigint library: same functionality, an identical README file, and even an author name uncomfortably close to the original maintainer.

Most of the time, this pattern indicates common supply-chain attacks, such as typosquatting and dependency confusion, designed to compromise systems and exfiltrate secrets. But this one felt different almost immediately.

It was not trying to hit everyone. It was trying to hit something.

The hijack

At first glance, json-bigint-extend behaves exactly like the legitimate json-bigint library: it exports the familiar parse/stringify functions used to support large integers in JSON. In fact, most developers and organizations wouldn’t notice anything unusual. This payload is specifically engineered to stay quiet and only trigger when it detects it is running inside a specific target environment, by checking the value of a specific environment variable called SERVICE_NAME.

Once it detects it is in the right environment, it installs two backdoors:

First, it installs a targeted Express middleware, wired specifically into a payment route (/v1/pay/purchase-goods). This middleware is designed to dynamically execute additional code fetched from an endpoint. Upon further inspection of the fetched code, it seems to be a complex cashflow-rewriting system used to manipulate a gambling game.

const routeInjectionRules = {
    '/v1/pay/purchase-goods': {
      identify: function (handlers, fn, index) {
        ...
      },
      position: 'after',
      extraMiddlewares: [function (req, res, next) {
       // Translation: [Plugin] Mount risk middleware as post-payment success logic.
log('[插件] 支付成功后的后置逻辑挂载risk'); 
       riskCode(req, res, next); // Executes dynamically fetched code
      }]
    }
  };

Secondly, a prototype-level middleware that quietly monkey-patches Express.js, adding global middleware to every POST route. This middleware listens for a secret x-operation header and unlocks four types of commands to the operator:

  1. RunSQL: execute arbitrary SQL against the production database.
  2. RunFileList: list server-side files and directories.
  3. RunFileContent: download the contents of a chosen file.
  4. CompressDownload: download a directory as a zip file.

The operator dashboard

Inside the package, there is also an embedded HTML page for a “Directory compression download service” (Chinese title: 目录压缩下载服务).

Operator Dashboard

While this page was never hooked up anywhere in the backdoor code we observed, it appears to be an operator-facing UI for browsing and exfiltrating directories as zip files.

Manipulating gambling outcomes

The scary part: that riskCode(...) function called in the middleware is remote-controlled and updated every 30 seconds.

While the payload is not actively invoked (yet), we observed logic capable of retroactively adjusting a user's recent game history. The most sophisticated component of this backdoor is the fixFlow function, a balance manipulation engine that retroactively rewrites a user's gambling history to achieve a desired balance change while maintaining the appearance of legitimate gameplay.

The main orchestration happens in this fixFlow, which executes a four-phase pipeline:

// Takes a desired amount as argument
async fixFlow(backupAmount) {


  // Phase 1: Load recent cashflow records
  const original = await this.getCashFlow();
  
  // Phase 2: Compute required adjustments to betting history
  const adjuster = new GameResultAdjuster({ debug: false });
  const adjustResult = adjuster.adjustDBData(original, backupAmount);
  const { backupRecords, adjustedResult } = adjustResult;
  const rewritten = this.writeBackFlowData(backupRecords);
  
  // Phase 3: Validate consistency
  const validation = this.validateCashFlowChain(...);
  if (!validation.isValid) {
    ...
  }
  
  // Phase 4: Persist to database
  await this.updateUserCashFlow(rewritten);
  await sendToUser(userId, { pop: false });
  await this.updateUserGameRoundFlow(gameTasks);
  
}

The function loads recent cash-flow records and converts them into structured game logs. Afterwards, the adjustDBData method generates replacement betting outcomes engineered to produce a fabricated balance change. What’s interesting is that instead of relying on one algorithm, it runs two competing strategies (greedy vs backtracking), and selects the approach with the highest "realism" score. After verifying the rewritten balance chain for consistency, updateUserCashFlow and updateUserGameRoundFlow write the altered records via Prisma back into the live production database, while sendToUser pushes the updated balance event to the user’s device.

Greedy Fraud Strategy

The greedy approach divides the desired target amount evenly across available rounds. It's fast but produces suspicious patterns. Imagine you need to distribute 300 fabricated coins across 3 game rounds. The greedy approach simply divides evenly: 100 per round. For each round, it sets the payout to achieve that round's desired result. However, this has the tendency to look fake. Real games don't hit consistent results every single round.

Backtracking Search

The backtracking approach explores the full solution space, trying different bet/payout combinations until finding one that hits the desired target within a 0.01% error margin. Instead of committing to decisions immediately, it explores the full tree of possibilities. Try a bet amount, see where it leads, and if it doesn't work out, undo it and try a different bet. This is like solving a maze by trying every path until you find the exit. This approach finds a realistic chain of results that accounts for constraints, such as the user's available cash at the time of betting.

It works something like this:

  1. Generate a list of possible bet amounts
  2. Filter out bets the user can't afford
  3. Score each by "reachability" to the desired target
  4. Try the best-scoring option first
  5. If it leads to success, we're done
  6. If it leads to failure, undo and try the next bet

The algorithm employs several optimizations, such as memoization to avoid re-exploration of failed attempts, and reachability pruning to skip branches that cannot mathematically reach the desired target.

Quality Scoring: Making Fraud Look Natural

After both strategies run, the system applies a sophisticated quality scoring mechanism that evaluates how "realistic" a forged gambling history appears. This score determines which fraud strategy's output gets used, and serves as a metric for the attack's success.

// Generate a quality score
const overallQuality = this.evaluateLogsQuality(adjustedGameLogs, completeness.actualNetGain);

The evaluateLogsQuality function starts at 100 points and deducts penalties for suspicious patterns. Some of these penalties include:

  • Impossible Bets (Penalty: -100): A bet that exceeds the available balance is impossible in real gameplay. It would be rejected by the game server.
  • Orphan Payouts (Penalty: -2): A payout without a corresponding bet in the same round is structurally invalid. In legitimate gameplay, every payout is the result of a bet. A payout appearing out of nowhere suggests record tampering.
  • Interleaved Rounds (Penalty: -1 to -40 by severity): Real players typically complete one round before starting another. Excessive interleaving, i.e., starting multiple rounds simultaneously, looks like bot behavior or manipulation.
  • Unrealistic Multipliers (Penalty: -15): Winning at 100x or higher is rare. If more than 10% of rounds show extreme multipliers, the pattern looks fabricated and a penalty is applied. The simple greedy algorithm has the tendency to produce this pattern.
  • Monotonous Gameplay (Penalty: -10): A player who loses every single round across many games is suspicious, even unlucky players win occasionally.

In conclusion, it means the goal is not just fraud. It is fraud that survives internal consistency checks, fabricating wins and losses while keeping accounting consistent using a clever anti-detection mechanism.

Bappa Rummy

We can’t say for certain which game is being targeted, but surrounding references suggest it may be a gambling app called Bappa Rummy. One of the endpoints referenced in the file is gameland.myapptest.top/v1, and a quick SSL certificate transparency search for that domain shows related hosts like gali.web.test.myapptest.top. Inspecting it reveals what looks like a broken landing page tied to Bappa Rummy, making it a plausible target of the backdoor. The app seems to be widely promoted online through referral programs and alternative app stores, but is no longer listed on the official Google Play Store.

Detection and prevention

While we don't know who is behind the backdoor, the scary part is what it does once it lands in the right environment. This is not “just” a typical dependency implant that exfiltrates source code, secrets, or customer data.

Instead, it hooks directly into business logic, executes remote-controlled code on real traffic, and can rewrite database-backed financial history. If your monitoring assumes database logs are trustworthy, this kind of manipulation can stay invisible for a long time.

If you already use Aikido, this package would be flagged in your feed as a 100/100 critical finding.

Not on Aikido yet? Create a free account and link your repositories. The free plan includes our malware detection coverage (no credit card required).

Finally, having a tool that can stop malware in real time as it appears can prevent a serious infection. This is the idea behind Aikido Safe Chain, a free and open-source tool that wraps around npm, npx, yarn, pnpm, and pnpx and uses both AI and human malware researchers to detect and block the latest supply chain risks before they enter your environment.

Indicators of compromise

Packages and authors:

  • jsonfb (by sidoraress)
  • jsonfx (by sidoraress)
  • json-bigint-extend (by sidoraress & infinitynodestudio)

The backdoor communicates with a remote host for both payload updates and logging.

Observed endpoints:

  • https://payment[.]y1pay[.]vip/v1/risk/get-risk-code
  • https://payment[.]y1pay[.]vip/v1/risk/log
  • https://payment[.]snip-site[.]cc
  • https://gameland[.]21game[.]live
  • https://gameland[.]myapptest[.]top/v1
  • https://gameland[.]nbzysp1[.]com/v1
  • https://gameland[.]21game[.]live/v1

Other IOCs and huntable behaviors:

  • Requests containing x-operation header with one of the four operation tokens:
    • RunSQL (token: cfh2DNITa84qpYQ0tdCz)
    • RunFileList (token: m3QiEkg8Y1r9LFTI5e4f)
    • RunFileContent (token: Y3SrZjVqWOvKsBdpTCh7)
    • CompressDownload (token: SJQf31UJkZ1f88q9m361)
  • Runtime modifications to express.Route.prototype.post