Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
Is it safe to "eval" the result of pythons (built-in) json.load?

I'm writing an application in Adobes ExtendScript (older version of Javascript) where I need to parse very large json files. To do this I'm using the json2 library as there is no built-in method.

The files can often be about 10mb in size and (mostly) contains lists/dicts with tens of thousands of numbers/strings. Parsing this in Python using json.load is almost instant, but in ExtendScript it takes around 25 minutes (!).

The only way I've found to speed up this is to "eval" the code directly (no parsing) to a Javascript object. This turns the process down to something very similar to Python. Obviously it doesn't feel great to eval the code as the json files can come from different sources.

One idea I've been playing with is to let Python "validate" the content of the file before calling eval. Something like this:

  • Call Python from Javascript and let Python parse the file using json.load. Return the result to Javascript as a string.
  • Call Javascripts eval on the result from Python.

Would this be considered safe? Or does this not clean the json enough to remove and security risks?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!