mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-18 22:44:24 +01:00
Fix access to unreleased challenges through /chals/<id> endpoint (#689)
This commit is contained in:
@@ -133,6 +133,8 @@ def chal_view(chal_id):
|
|||||||
teamid = session.get('id')
|
teamid = session.get('id')
|
||||||
|
|
||||||
chal = Challenges.query.filter_by(id=chal_id).first_or_404()
|
chal = Challenges.query.filter_by(id=chal_id).first_or_404()
|
||||||
|
if chal.hidden:
|
||||||
|
abort(404)
|
||||||
chal_class = get_chal_class(chal.type)
|
chal_class = get_chal_class(chal.type)
|
||||||
|
|
||||||
tags = [tag.tag for tag in Tags.query.add_columns('tag').filter_by(chal=chal.id).all()]
|
tags = [tag.tag for tag in Tags.query.add_columns('tag').filter_by(chal=chal.id).all()]
|
||||||
|
|||||||
Reference in New Issue
Block a user