Bug description:
The two endpoints of the PDF extractor API accept a PDF from anyone, without
authentication:
/api/pdf-extractor/metadata
/api/pdf-extractor/full-text
They forward the file to Grobid, which is costly in CPU and memory, so the
endpoints can be used to exhaust the server resources.
The only page calling them, /pdf-extractor/test, does require a login.
Expected behavior:
Both endpoints should require an authenticated user.
Steps to Reproduce:
- Make sure you are not logged in.
- POST a PDF to
/api/pdf-extractor/full-text, in a file form field.
- See that the extracted text is returned with a 200.
Confirmed on sonardev: an anonymous POST to /api/pdf-extractor/full-text
returns 200 with the extracted text, and a POST to /api/pdf-extractor/metadata
runs Grobid (~2 s) without any login.
Context
Bug description:
The two endpoints of the PDF extractor API accept a PDF from anyone, without
authentication:
/api/pdf-extractor/metadata/api/pdf-extractor/full-textThey forward the file to Grobid, which is costly in CPU and memory, so the
endpoints can be used to exhaust the server resources.
The only page calling them,
/pdf-extractor/test, does require a login.Expected behavior:
Both endpoints should require an authenticated user.
Steps to Reproduce:
/api/pdf-extractor/full-text, in afileform field.Confirmed on sonardev: an anonymous POST to
/api/pdf-extractor/full-textreturns 200 with the extracted text, and a POST to
/api/pdf-extractor/metadataruns Grobid (~2 s) without any login.
Context