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
25 lines
912 B
Python
25 lines
912 B
Python
# Provenance: erev0s/VAmPI get_user (vuln).
|
|
# repo: erev0s/VAmPI
|
|
# commit: 1713b54b601ad29582581eeda4b31fceb1319874
|
|
# parent: 1713b54b601ad29582581eeda4b31fceb1319874
|
|
# commit_url: https://github.com/erev0s/VAmPI/blob/1713b54b601ad29582581eeda4b31fceb1319874/models/user_model.py#L72
|
|
# cve:
|
|
# license: MIT
|
|
# function: get_user
|
|
# relpath: models/user_model.py
|
|
# provenance: human
|
|
# mechanism: source_reaches_sink
|
|
|
|
def get_user(username):
|
|
if vuln: # SQLi Injection
|
|
user_query = f"SELECT * FROM users WHERE username = '{username}'"
|
|
query = db.session.execute(text(user_query))
|
|
ret = query.fetchone()
|
|
if ret:
|
|
fin_query = '{"username": "%s", "email": "%s"}' % (ret[1], ret[3])
|
|
else:
|
|
fin_query = None
|
|
else:
|
|
fin_query = User.query.filter_by(username=username).first()
|
|
return fin_query
|