Do stricter check using regex to validate hex UUID value
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
Research direction
Start in morango/models/fields/uuids.py at get_db_prep_value, where the traceback shows the value is converted with uuid.UUID. Review the existing conversion and add the requested regex-based hexadecimal UUID validation so malformed values such as the reported path are rejected before conversion; done means the invalid input no longer reaches the failing conversion.
Written by the indexing model from the issue text.
Description
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)
- Dominant language
- Python
- Stars
- 15
- Forks
- 23
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from learningequality/morango
-
Difficulty 3/5 1-2 days Newbie friendliness 58/100
learningequality/morango#349 ·
-
DEV: backend P0 - critical
learningequality/morango#340 · 1 assignee ·
-
DEV: backend TAG: new feature TAG: performance
learningequality/morango#317 · 1 assignee ·
-
P1 - important
Difficulty 3/5 1-2 days Newbie friendliness 45/100
learningequality/morango#308 · 1 comment ·
-
DEV: backend P0 - critical
learningequality/morango#305 · 1 assignee ·
All issues in learningequality/morango
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stephrobert/dsoxlab#238 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sublimehq/package_control#1780 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
nwg-piotr/nwg-displays#145 ·