mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-18 20:49:28 +00:00
Tasks 1.1, 5.1, 5.2, 5.4 and the data half of 5.3. - mechanisms.toml: closed vocabulary v1 (20 ids) every expected row cites. - vibe-py: 35 Real-Vuln-Benchmark pairs (Apache-2.0), human provenance only because the LLM-generated repositories carry no license (escalated). - vfc-js: 17 Node fix-commit pairs harvested upstream (MIT/Apache-2.0), SecBench.js itself is not vendored (no license); sinks derived on 13/17. - agent-vfc: 29 agent-trailer fixes as catalog-candidates.toml plus REVIEW.md; the loaded catalog stays empty until a human reviews them. - datasets.toml and README document every slice and its review status. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
41 lines
1.8 KiB
Python
41 lines
1.8 KiB
Python
# Provenance: erev0s/VAmPI get_by_title (fixed).
|
|
# repo: erev0s/VAmPI
|
|
# commit: 1713b54b601ad29582581eeda4b31fceb1319874
|
|
# parent: 1713b54b601ad29582581eeda4b31fceb1319874
|
|
# commit_url: https://github.com/erev0s/VAmPI/blob/1713b54b601ad29582581eeda4b31fceb1319874/api_views/books.py#L51
|
|
# cve:
|
|
# license: MIT
|
|
# function: get_by_title
|
|
# relpath: api_views/books.py
|
|
# provenance: human
|
|
# mechanism: missing_auth_guard
|
|
|
|
def get_by_title(book_title):
|
|
resp = token_validator(request.headers.get('Authorization'))
|
|
if "error" in resp:
|
|
return Response(error_message_helper(resp), 401, mimetype="application/json")
|
|
else:
|
|
if vuln: # Broken Object Level Authorization
|
|
book = Book.query.filter_by(book_title=str(book_title)).first()
|
|
if book:
|
|
responseObject = {
|
|
'book_title': book.book_title,
|
|
'secret': book.secret_content,
|
|
'owner': book.user.username
|
|
}
|
|
return Response(json.dumps(responseObject), 200, mimetype="application/json")
|
|
else:
|
|
return Response(error_message_helper("Book not found!"), 404, mimetype="application/json")
|
|
else:
|
|
user = User.query.filter_by(username=resp['sub']).first()
|
|
book = Book.query.filter_by(user=user, book_title=str(book_title)).first()
|
|
if book:
|
|
responseObject = {
|
|
'book_title': book.book_title,
|
|
'secret': book.secret_content,
|
|
'owner': book.user.username
|
|
}
|
|
return Response(json.dumps(responseObject), 200, mimetype="application/json")
|
|
else:
|
|
return Response(error_message_helper("Book not found!"), 404, mimetype="application/json")
|