Skip to content

[BUG] Lose Arguments #887

@BlackYuzia

Description

@BlackYuzia

Description

Hi there. I didn't write on e-mail this time, because that just a bug report (ONE MORE KRUZYA :D)
So, I try obfuscate some code. I use plural-ru, but I think this isn't trouble of plural-ru package.

So, in short description. If I right, obfuscator with next config:

{
    "controlFlowFlattening": true,
    "controlFlowFlatteningThreshold": 1.0,
}

Just lose a few arguments by spread operator. For more check examples.

Steps to reproduce

  1. Create function with spread operator (...some_array).
  2. Obfuscate with my settings.
  3. Profit.

Examples

Oh shit, here we go again...

Original:

// index.js | Я упростил код до 2 + 2. 
const plural = require("plural-ru");
const translate = ["Kruzya", "Is", "P..."];
plural(online, ...translate); // in this line I found bug, but go next...

Obfuscated:

_0x102640['HrGnp'](plural, online, ...translate); 

Function:
image

How you can see, function can send only 3 arguments.

  • first: plural,
  • second: online,
  • third: array.

But in third argument we have a bug ... because ...translate => arg1,arg2,arg3, ..., argn (n = length of array).
So, here we get 5 arguments, but sended only 3.

Result of this exec:
image

This is a potential bug of obfuscator 👀

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions