←back to thread

1208 points jamesberthoty | 2 comments | | HN request time: 0.408s | source
1. parhamn ◴[] No.45268412[source]
For a large subset of packages (like the browser ones), as a layman, it seems feasible to do static analysis for:

1) fetch calls

2) obfuscation (like sketchy lookup tables and hex string construction)

Like for (1) the hostname should be statically resolvable and immutable. So you can list the hostnames it fetches from as well.

Is this feasible or am I underestimating the difficulty? Javascript seems to have no shortage of static analysis tools.

replies(1): >>45268931 #
2. TheDong ◴[] No.45268931[source]
There are many ways to "eval" in javascript, and static analysis can only work if that's also statically disallowed.

Unfortunately, eval is still used in a lot of code, so disabling it isn't trivially viable, and with eval present, detecting fetch calls and such statically becomes the halting problem.