Skip to content

Issue with two separated obfuscated files on the same page #58

Closed

Description

@slig

Hi,

I think I found an issue. I have two independent javascript files on a page, each one obfuscated by the webpack-obfuscator plugin (i.e: different bundles on different <script> tags). Since they both use the same configuration from webpack.conf.js, they have the same seed config and thus the first variable name that is used on the stringArray variable is the same for both obfuscated files. That is an issue as the variable used by stringArray is a global and gets replaced by the second script.
Then somewhere after loading the scripts, any interaction from the first bundle with the stringArray function will look at the second bundle stringArray variable.

Possible workarounds that I could think:

  1. Have the obfuscator output an immediately invoked function that would scope the variable and not leak them to the global scope.
  2. Use the seed parameter plus an hash of the source code as the real seed used by the obuscator. This is not fail-proof as it still might generate two variables with the same name and mess things.

Thanks!

Activity

  1. added this to the 0.10.0 milestone on Jun 21, 2017
  2. sanex3339 commented on Jun 27, 2017

    @sanex3339
    Member

    I like second option.

  3. sanex3339 commented on Jun 27, 2017

    @sanex3339
    Member

    I'll implement it today or tomorrow.

  4. sanex3339 commented on Jun 28, 2017

    @sanex3339
    Member

    Did it, new beta will be ready in 20 mins.

  5. sanex3339 commented on Jun 28, 2017

    @sanex3339
    Member

    Hi, check new [email protected]

  6. slig commented on Jun 28, 2017

    @slig
    Author

    Thank you very much, will try!

  7. sanex3339 commented on Jul 3, 2017

    @sanex3339
    Member

    Any news?

  8. slig commented on Jul 3, 2017

    @slig
    Author

    Sorry for not reporting before. It does work perfectly as expected, thank you very much!

  9. sanex3339 commented on Jul 3, 2017

    @sanex3339
    Member

    Nice! I'll close issue than.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions