Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

262
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda