Skip to content

Check the format of job IDs that go into request paths (GEO-5413) - #9

Merged
artsiom-kz-geonode merged 1 commit into
mainfrom
fix/make-job-id-format
Nov 27, 2026
Merged

artsiom-kz-geonode merged 1 commit into
mainfrom
fix/make-job-id-format

Conversation

@artsiom-kz-geonode

Copy link
Copy Markdown
Collaborator

Refs GEO-5413
Done when: "../statistics" in a Get status module is rejected by Make in the private app

Summary

Review finding before submission: five modules put the Job ID straight into the request path (/batch/{{parameters.job_id}}, /crawl/..., /extract/...). A value like ../statistics reached another API route; for Cancel a batch and Cancel a crawl that was a DELETE. The risk is low (the user's own key and data), but the field should not allow it.

The job_id field in Get a batch, Cancel a batch, Get a crawl, Cancel a crawl and Get an extraction job now has "validate": { "pattern": "^[A-Za-z0-9_-]+$" }, the same syntax as the proxy country field. Real job IDs are UUIDs such as 01a21393-fafa-75e6-a79a-df792e21ccab and still pass. The job ID filter in Search extraction jobs goes into the query string, not the path, so it is unchanged.

Tests

  • New test_job_ids_in_paths_are_checked: finds every module whose request path uses {{parameters.job_id}} (5), and checks that its pattern accepts a real job ID and rejects ../statistics, a/b, a?b, a#b and an empty value.
  • test_client_header, test_publish_safety, test_review_rules: OK. 86 app files parse as JSON.
  • Not checked yet: Make's own validation in a live run (see After merge).

After merge

  • Run the Publish workflow with dry_run unticked to update the private app.
  • In the "Geonode: all actions" scenario, set Job ID of Get a batch to ../statistics and run that module: Make should reject the value. Then put the mapping back.

Get a batch, Cancel a batch, Get a crawl, Cancel a crawl and Get an
extraction job put the Job ID straight into the request path, so a
value like ../statistics reached another API route, and for the cancel
modules that was a DELETE. The Job ID field now accepts only letters,
digits, - and _, so Make rejects such a value before the request. Real
job IDs are UUIDs and still pass.
@artsiom-kz-geonode
artsiom-kz-geonode merged commit 9146d16 into main Nov 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant