Skip to content

Commit

Permalink
nfctokens: always reject auth for random UIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
timhawes committed Sep 29, 2023
1 parent 37746ac commit 7874122
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nfctokens/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ def nfc_token_auth(request):
required_groups = data.get("groups")
exclude_groups = data.get("exclude_groups", [])

if len(uid) == 8 and uid.startswith("08"):
return JsonResponse(
{"found": False, "authorized": False, "reason": "Random UID not allowed"}
)

# lookup the token
try:
token = NFCToken.objects.get(uid=uid)
Expand Down

0 comments on commit 7874122

Please sign in to comment.