mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
[pitboss] phase 21: Track M.3 — ScheduledJob + GraphQLResolver + WebSocket + Middleware + Migration
This commit is contained in:
parent
00b0fbaea9
commit
f9bd51c024
84 changed files with 5898 additions and 40 deletions
8
tests/dynamic_fixtures/migration/flask/benign.py
Normal file
8
tests/dynamic_fixtures/migration/flask/benign.py
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
"""Phase 21 — Alembic benign control."""
|
||||
_NYX_ADAPTER_MARKER = "from alembic import op"
|
||||
revision = "deadbeef0001"
|
||||
|
||||
|
||||
def upgrade(column_name="email"):
|
||||
safe = "".join(c for c in str(column_name) if c.isalnum() or c == "_")
|
||||
return "ALTER TABLE users ADD COLUMN " + safe + " TEXT"
|
||||
22
tests/dynamic_fixtures/migration/flask/vuln.py
Normal file
22
tests/dynamic_fixtures/migration/flask/vuln.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Phase 21 (Track M.3) — Flask-Migrate / Alembic migration vuln.
|
||||
|
||||
Alembic revisions declare an `upgrade()` function that issues DDL
|
||||
through `op.execute(...)`. The vuln fixture splices a tainted column
|
||||
name into the statement via raw string concat.
|
||||
"""
|
||||
_NYX_ADAPTER_MARKER = "from alembic import op"
|
||||
revision = "abc123def4"
|
||||
down_revision = None
|
||||
|
||||
|
||||
class _Op:
|
||||
def execute(self, sql):
|
||||
print("ALEMBIC_SQL:", sql)
|
||||
|
||||
|
||||
op = _Op()
|
||||
|
||||
|
||||
def upgrade(column_name="email"):
|
||||
# SINK: tainted column name spliced into raw DDL.
|
||||
op.execute("ALTER TABLE users ADD COLUMN " + str(column_name) + " TEXT")
|
||||
Loading…
Add table
Add a link
Reference in a new issue