Flagsmith/flagsmith

Null-terminated query parameters cause server errors in the Core SDK endpoints

Open

#2901 aperta il 30 ott 2023

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Python (264 fork)batch import
buggood first issue

Metriche repository

Star
 (3475 star)
Metriche merge PR
 (Merge medio 3g 7h) (157 PR mergiate in 30 g)

Descrizione

Example Sentry issue: FLAGSMITH-API-3TZ

ValueError: A string literal cannot contain NUL (0x00) characters.
(15 additional frame(s) were not displayed)
...
  File "environments/identities/views.py", line 185, in get
    .get_or_create(identifier=identifier, environment=request.environment)

This should be a problem for every view that accesses query parameters directly.

A quick search yields 8 occurences of this: https://github.com/search?q=repo%3AFlagsmith%2Fflagsmith+query_params.get&type=code

For each of those we need to assess the performance impact of using a serializer (DRF's CharField handles null chars).

Guida contributor