Files
Open_Ultra_SAST/benchmarks/pairs/vibe-py/dsvpwa-dsvpwa-main/vuln.py
T
Marius CiepluchandClaude Fable 5.1 8ab4207618 feat(pair-corpus-honesty): add vibe-py, vfc-js and agent-vfc slices with mechanism vocabulary
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
2026-09-05 10:45:42 +02:00

53 lines
2.1 KiB
Python

# Provenance: sgabe/DSVPWA main (vuln).
# repo: sgabe/DSVPWA
# commit: a06abb306ed3699bb2f073e3f41d3d9c57012819
# parent: a06abb306ed3699bb2f073e3f41d3d9c57012819
# commit_url: https://github.com/sgabe/DSVPWA/blob/a06abb306ed3699bb2f073e3f41d3d9c57012819/dsvpwa.py#L37
# cve:
# license: MIT
# function: main
# relpath: dsvpwa.py
# provenance: human
# mechanism: permissive_default
def main():
parser = argparse.ArgumentParser(prog='DSVPWA',
description='Damn Simple Vulnerable Python Web Application')
parser.add_argument('--host', default='127.0.0.1',
help='set the IP address to bind to (defaults to 127.0.0.1)')
parser.add_argument('--port', type=int, default=os.getenv('DSVPWA_PORT', 65413),
help='set the port number to bind to (defaults to 65413)')
parser.add_argument('--risk', type=int, default=os.getenv('DSVPWA_RISK', 1), choices=range(1,4),
help='set the risk level in the range 1-3')
parser.add_argument('--ssl', action='store_true', default=os.getenv('DSVPWA_SSL', 0),
help='enable encryption (defaults to false)')
parser.add_argument('--version', action='version',
version='%(prog)s v{} ({})'.format(BUILD_VER, BUILD_REV))
args = parser.parse_args()
proto = 'http' if not args.ssl else 'https'
try:
httpd = VulnHTTPServer((args.host, args.port), VulnHTTPRequestHandler)
httpd.RequestHandlerClass.risk = args.risk
if args.ssl:
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ctx.options &= ~ssl.OP_NO_SSLv3
ctx.options &= ~ssl.OP_NO_COMPRESSION
ctx.options &= ~ssl.OP_CIPHER_SERVER_PREFERENCE
ctx.load_cert_chain(certfile='./ssl/cert.pem', keyfile='./ssl/key.pem')
httpd.socket = ctx.wrap_socket(httpd.socket, server_side=True)
print('[*] Navigate to {}://{}:{} to access DSVPWA'.format(proto, args.host, args.port))
httpd.serve_forever()
except KeyboardInterrupt:
print('[*] Quitting...')
pass
except Exception as ex:
print("[!] Exception occurred ('%s')" % ex)
finally:
httpd.server_close()
os._exit(0)