Alta

pyload Unauthenticated Flask Configuration Leakage vulnerability

  • Publicada: 08.01.2024
  • Actualizado: 11.10.2026 15:17

Summary

Any unauthenticated user can browse to a specific URL to expose the Flask config, including the SECRET_KEY variable.

Details

Any unauthenticated user can browse to a specific URL to expose the Flask config, including the SECRET_KEY variable.

PoC

Run pyload in the default configuration by running the following command

pyload

Now browse to http://localhost:8000/render/info.html. Notice how the Flask configuration gets displayed. PoC

I was quite amused by this finding. I think it's a very interesting coming together of things that is so unlikely to happen. Below I will detail my process a bit more.

I was looking through the code to see how the authorization mechanism is implemented when I spotted this route, which can be accessed by any unauthenticated actor

python
@bp.route("/render/<path:filename>", endpoint="render")
def render(filename):
    mimetype = mimetypes.guess_type(filename)[0] or "text/html"
    data = render_template(filename)
    return flask.Response(data, mimetype=mimetype)

This route allows me to load in any of the predefined templates. However, these templates will be lacking any form of context, and as such it doesn't seem too useful. That is until I loaded the info.html template and scrolled down, revealing the Flask config. This was purely accidental, and I did not understand why it happened, until I looked at the template

python
    <tr>
        <td>{{ _("Config folder:") }}</td>
        <td>{{ config }}</td>
    </tr>

In Flask, every template always gets the Flask config passed to it as the config variable. In the normal execution of this template, this value gets overwritten in the function below, but since we're calling it and bypassing this function altogether, it doesn't get overwritten. Would this variable not be named config and named configuration or Config instead, then this exploit wouldn't work. The likelihood of this occurring is so small, but it seems to have happened here.

python
    context = {
        "python": sys.version,
        "os": " ".join((os.name, sys.platform) + extra),
        "version": api.get_server_version(),
        "folder": PKGDIR,
        "config": api.get_userdir(),
        "download": conf["general"]["storage_folder"]["value"],
        "freespace": format.size(api.free_space()),
        "webif": conf["webui"]["port"]["value"],
        "language": conf["general"]["language"]["value"],
    }
    return render_template("info.html", **context)

Impact

Depending on the how the Flask config data is used, it could have detrimental consequences for the security. It's crucial to keep the SECRET_KEY secret and never expose it in your code or configuration files.

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) pyload-ng < 0.5.0b3.dev77 0.5.0b3.dev77

Referencias

Puntuación CVSS 7.5/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Debilidad (CWE)
CWE-284
Plataforma
Python (PyPI)
Paquete
pyload-ng
Publicada
08.01.2024
Actualizado
11.10.2026 15:17

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2026-1820 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-mqpq-2p68-46fv - CC BY 4.0

Historial de vulnerabilidades: pyload-ng

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (58) en el archivo
Entradas en total
58
Primera → última
01.2023 10.2026
Sin corrección
24
Explotada en ataques
0

Distribución por gravedad

  • Crítica 9
  • Alta 23
  • Media 25
  • Baja 1

Divulgaciones por año

  1. 2023: 9
  2. 2024: 8
  3. 2025: 8
  4. 2026: 33
Gravedad:
  1. Alta · 7.5 ghsa-889w-m37p-88m5 >= 0.5.0b3.dev98, <= 0.5.0b3.dev101 sin corrección
  2. Alta · 8.1 ghsa-r44w-v6gf-x3p6 < 0.5.0b3.dev101 0.5.0b3.dev101
  3. Alta · 8.1 CVE-2026-42315 < 0.5.0b3.dev100 0.5.0b3.dev100
  4. Alta · 8.8 CVE-2026-41133 <= 0.5.0b3.dev97 sin corrección
  5. Alta · 8.8 CVE-2026-35463 <= 0.5.0b3.dev96 sin corrección
  6. Alta · 7.7 CVE-2026-35187 <= 0.5.0b3.dev96 sin corrección
  7. Alta · 7.1 CVE-2026-29778 >= 0.5.0b3.dev13, < 0.5.0b3.dev97 0.5.0b3.dev97
  8. Alta · 8.1 CVE-2025-61773 < 0.5.0b3.dev91 0.5.0b3.dev91
  9. Alta CVE-2025-57751 < 0.5.0b3.dev92 0.5.0b3.dev92
  10. Alta · 7.5 CVE-2025-54140 >= 0.5.0b3.dev89, < 0.5.0b3.dev90 0.5.0b3.dev90
  11. Crítica · 9.8 CVE-2025-53890 < 0.20 0.20
  12. Crítica · 9.8 CVE-2024-39205 <= 0.5.0b3.dev85 sin corrección
  13. Crítica · 9.1 CVE-2024-32880 <= 0.5.0 sin corrección
  14. Crítica · 9.6 CVE-2024-22416 < 0.5.0b3.dev78 0.5.0b3.dev78
  15. pyload Unauthenticated Flask Configuration Leakage vulnerability esta entrada
    Alta · 7.5 CVE-2024-21644 < 0.5.0b3.dev77 0.5.0b3.dev77
  16. Alta · 7.6 CVE-2023-47890 < 0.5.0b3.dev75 0.5.0b3.dev75
  17. Alta · 7.4 CVE-2023-0509 < 0.5.0b3.dev44 0.5.0b3.dev44
  18. Crítica · 9.8 CVE-2023-0435 < 0.5.0b3.dev41 0.5.0b3.dev41
  19. Crítica · 9.8 CVE-2023-0297 < 0.5.0b3.dev31 0.5.0b3.dev31

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.