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

208
Visualizações
In a browser, is it possible to safely get a JSON resource from an external URL provided by the user?

I want to let users open my web app through a link that already contains the URL to the external resource. Then the web app needs to fetch this external resource and render content on the page based off of it.

This feature is important to me in order to allow users to integrate my app with their app or their own datasource.

Assuming my web app is hosted at example.com, a user needs to be able to open a link such as

https://example.com/view?resource=https%3A%2F%2Fexternal-hosting.net%2Ffile%2F24345

then based on this my code will

const data = await fetch('https://external-hosting.net/file/24345')
const dataJSON = await data.json()

Is it possible to safely retrieve such JSON data directly in the browser, if there's no way to make sure that the URL can be trusted?

What security vulnerabilities does this introduce and can they be mitigated?

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