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

135
Visualizações
Is my extremely simple website safe agains XSS?

I made a website that gets your request path and returns it in a <link> tag like this:

<link rel="canonical" href="PATH_HERE">

You can go to any path you want and insert whatever you want in there, and the only the thing that gets sanitized are double quotes (").

The backend:

from flask import Flask
app = Flask(__name__)

# Catch every possible route
@app.route('/', defaults={'path': '/'})
@app.route('/<path:path>')
def catch_all(path):
    path = path.replace('"', "&quot;")
    return f"""
<head>
    <title>Website</title>
    <link rel="canonical" href="{path}">
</head>
    """

if __name__ == '__main__':
    app.run(host="0.0.0.0", port=8080)

Here's the HTML returned when making a request to https://website.com/hello:

<html><head>
    <title>Website</title>
    <link rel="canonical" href="hello">
</head>
    <body></body></html>

And here's the HTML returned when making a request to https://website.com/"</link><script>alert(1)</script>:

<html><head>
    <title>Website</title>
    <link rel="canonical" href="&quot;</link><script>alert(1)</script>">
</head>
    <body></body></html>

I'm wondering if it's even possible to make use of XSS in this website?

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