[bug]: Asset upload returns 500 when size is not a number, and accepts zero or negative sizes

Abierto
#10,387 1 comentario 0 reacciones 2 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@vihar ya está trabajando en esto.

Desde el 24/11/2026.

  • #10394 de @ashokram-si — abierto
  • #10416 de @avesh-pathak — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

🐛bug plane
Is there an existing issue for this?
  • I have searched the existing issues
Current behavior

The upload endpoints read the size with int(request.data.get("size", ...)), so a request with "size": "abc" or "size": null fails with ValueError or TypeError and a 500. A size of 0 or -5 is accepted and passed on to the presigned upload.

The same line is in apps/api/plane/app/views/asset/v2.py (user, workspace and project assets), apps/api/plane/api/views/asset.py (three endpoints), apps/api/plane/app/views/issue/attachment.py and apps/api/plane/space/views/asset.py. The work item attachment endpoint of the public API (apps/api/plane/api/views/issue.py) already handles this and answers with a 400.

Steps to reproduce
  1. POST /api/assets/v2/user-assets/ with {"name": "a.png", "type": "image/png", "size": "abc", "entity_type": "USER_AVATAR"}.
  2. The response is a 500 and the log shows invalid literal for int() with base 10: 'abc'.
  3. With "size": -5 the request succeeds with a 200 instead of a 400.
Environment

Production

Browser

None

Edition

Community

Version

v1.5.0 (also on preview at 723bb178f)

Lenguaje dominante
TypeScript
Estrellas
63k
Forks
6.5k
Merge medio
2 d 16 h
PR fusionados (30 d)
70

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de makeplane/plane

Todos los issues de makeplane/plane

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.