Issue with two separated obfuscated files on the same page
See original GitHub issueHi,
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:
- Have the obfuscator output an immediately invoked function that would scope the variable and not leak them to the global scope.
- 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!
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
are there any potential issues with obfuscating an application?
There are certainly some potential performance/maintenance issues, but a good obfuscator will let you get round at least some of them.
Read more >How to fix common obfuscation problems
Possible cause: Mixing obfuscated and non-obfuscated versions of the same JAR(s). Solution: Verify that the classpath only contains the obfuscated JARs.
Read more >Obfuscation or Encryption for Document Security?
Obfuscation involves a separate program that need to be packaged with a file or executable item to protect them from unauthorized use.
Read more >Dependent files break after obuscation · Issue #58 - GitHub
To get two dependent files to recognize one another in obfuscated code at runtime, you need to: Put them into the same fileset...
Read more >Obfuscation Technique - an overview | ScienceDirect Topics
Take two separate code components and interleave their statements in a common procedure. Make multiple copies of a single subroutine to make calling...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you very much, will try!
Hi, check new
javascript-obfuscator@0.10.0-beta.6