Skip to content

Do stricter check using regex to validate hex UUID value #178

@sentry

Description

@sentry

ValueError: invalid literal for int() with base 16: '//..//..//..//../WEBINF/web.xml\x00'

Sentry Issue: KOLIBRI-BACKEND-2D5

ValueError: invalid literal for int() with base 16: '//..//..//..//../WEBINF/web.xml\x00'
(19 additional frame(s) were not displayed)
...
  File "django/db/models/lookups.py", line 170, in as_sql
    rhs_sql, rhs_params = self.process_rhs(compiler, connection)
  File "django/db/models/lookups.py", line 103, in process_rhs
    return self.get_db_prep_lookup(value, connection)
  File "django/db/models/lookups.py", line 196, in get_db_prep_lookup
    [get_db_prep_value(value, connection, prepared=True)]
  File "morango/models/fields/uuids.py", line 39, in get_db_prep_value
    value = uuid.UUID(value)
  File "uuid.py", line 178, in __init__
    int = int_(hex, 16)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions