test: add static weak-assertion lint for attacker procedures - #12
Open
eastmadc wants to merge 1 commit into
Open
test: add static weak-assertion lint for attacker procedures#12eastmadc wants to merge 1 commit into
eastmadc wants to merge 1 commit into
Conversation
The attacker agent writes the exploit and the assertions that grade it, and
nothing checks that those assertions can tell a working exploit from a broken
one. An expect of status: 200, or a body_contains that also matches the error
page, passes a procedure that proves nothing -- green, in CI, forever.
Reports assertion shapes that cannot discriminate:
errors no_expect on the final step, status_only_2xx across a whole
procedure, exec_target_in_procedure, unparsed
warnings generic_text, short_text, tautological, no_dynamic_evidence,
unused_output
Severities were calibrated against tests/fixtures/procedures/. The first pass
errored on 4 of 5 fixtures, almost all false positives: stdout_contains: root
after whoami is a strong assertion, and a step that posts a payload and asserts
201 is fine when a later step verifies it fired. So the generic-word rule now
skips command output, and status-only is judged per procedure rather than per
step. Six of eight existing fixtures are clean; the two that error both use
exec_target, which their own headers describe as god-view -- correct for an
executor fixture, and a real bug in a generated procedure, so the rule stays.
No Docker and no model calls, so it runs under the standard contributor check.
16 tests, every rule covered in both directions.
Standalone: python -m goe.eval.procedure_lint tests/fixtures/procedures/
The dynamic half -- run each procedure against a baseline with the vulnerability
absent and require failure -- needs the executor and is not included here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The attacker agent writes the exploit and the assertions that grade it. Nothing
currently checks that those assertions can tell a working exploit from a broken
one — an
expectofstatus: 200, or abody_containsthat also matches theerror page, passes a procedure that proves nothing, green, in CI, forever.
This is the static half. It reads procedure YAML and reports assertion shapes
that cannot discriminate:
no_expecton the final step,status_only_2xxacross a whole procedure,exec_target_in_procedure,unparsedgeneric_text,short_text,tautological,no_dynamic_evidence,unused_outputCalibrated against your own fixtures. My first pass errored on 4 of 5 and
almost all were false positives —
stdout_contains: rootafterwhoamiis astrong assertion, and a step that posts a payload and asserts 201 is fine when a
later step verifies it fired. So the generic-word rule now skips command output,
and status-only is judged per procedure rather than per step. Six of the eight
fixtures are now clean.
The two that still error are
exec_and_listen.yamlandstep_chaining.yaml,both using
exec_target. Their headers say "god-view", so that's correct for anexecutor fixture — but
goe/models/procedure.pysays it's "never in L2procedures", so it's a real bug in a generated one. I've left the rule as an
error; happy to downgrade it or exclude fixtures if you'd rather.
No Docker, no model calls — runs under the standard contributor check. 16 tests,
every rule covered in both directions. Standalone:
The half that isn't here: the dynamic negative control — build each entity
with the vulnerability suppressed, run the same procedure, require it to fail. A
procedure that passes both targets is vacuous. That needs the executor and a
baseline fixture, so it's not in this PR, but it's the version with teeth and I'm
happy to draft it if you're interested.