Repository navigation
feat(ask_operator): tag requests that name hosts outside the goal (F12) - #197
Merged
Merged
Conversation
An ask_operator question that names a host or URL not among the task's goal targets is tagged "contains target-derived text": the hosts go into the transcript activity's Detail payload as target_derived_hosts, and the transcript shows the tag on the request card when the field is set. Hosts are read with intercept.ExtractTargets (the target gate's command-string rules) from both the question and the task goal, and compared without the port. The text the model reads, the pause, and the operator's decision are unchanged: the tag is a visible hint only. Audit F12, 0.7.0.
The goal gate accepts a goal that names its target as a bare domain (goalDomainRE), but the in-goal set was built only with commandTargets, which does not read bare hosts. A question citing the operator's own target as a URL was then tagged target-derived. goalTargets adds the goalDomainRE matches, widened to the whole dotted name, lowercased, port and path dropped. The question-side parser is unchanged.
usinfosec
pushed a commit
to usinfosec/ARTEX
that referenced
this pull request
Nov 17, 2026
fix: 密码初始化/登录接口在数据库读失败时 fail closed
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.
What
An
ask_operatorrequest whose question names a host or URL that is not among the task's goal targets is tagged "contains target-derived text", and the transcript shows that tag on the request card.server/ask_operator.go:targetDerivedHosts(question, goalTargets)is a pure function. It returns the out-of-goal hosts without duplicates, in order of appearance.commandTargetsreads a free text with the existing target extraction.askOperatorActivitystores the hosts as a field of the activity's Detail payload (target_derived_hosts), next totextandattachments.web/src/components/transcript.tsx:parseUserBodyreadstarget_derived_hosts.UserRowrenders an amber "Contains target-derived text: " label only when the field is set and not empty.The question text, the text the model reads, the pause and the operator's decision are unchanged. An untagged request keeps exactly the activity it had before.
Why
Audit F12, 0.7.0 queue. A worker that read target content can carry text from that content into a request to the operator, for example a command that points at a host the operator never named. The tag makes this visible on the card the operator decides on.
What counts as target-derived
A host that the question names but the task goal (
Task.Goal, written by the operator) does not.intercept.ExtractTargets, using the target gate's command-string rules (ExtractTargets("Bash", {"command": text})). These rules read URLs with a scheme, IP literals, IP:port, host:port and CIDR. No new parser was added.10.0.0.5:8443in the question matches10.0.0.5:8080in the goal.[targetless]goal, tags every host the question names.goalTargets) also takes the bare host names the goal gate accepts (goalDomainRE), widened to the whole dotted name, lowercased, port and path dropped, so a goal naming onlyapp.example.computs that host in the goal list (the question side is unchanged).Limits
nc evil.example.net 80is not tagged.http://evil.example.netandevil.example.net:80are tagged.task_scoperows are not consulted.Tests
All tests are pure: no database, run with
ARTEX_PG_DSNunset andARTEX_CONFIGpointing at a missing file.TestTargetDerivedHostscovers five cases. An in-goal host gives no tag. An out-of-goal host gives the tag. A URL whose host is in the goal gives no tag. An empty goal list tags any host. A request with no host gives no tag.TestAskOperatorActivityTag: an untagged request keeps the plain-text activity (empty Detail). A tagged request keeps the same text and carriesattachments: []plustarget_derived_hosts.!inGoal[t.Host]toinGoal[t.Host]).TestTargetDerivedHoststhen failed on 4 of 5 cases: in-goal, out-of-goal, in-goal URL and empty goal. The no-host case cannot detect the mutation, as expected. I restored the comparison and the test passes.Verification (Go in Kali, system Go 1.26.10):
go build ./...: exit 0.go vet ./...: exit 0.go test -count=1 ./server/:ok github.com/Autumn-27/artex/server 9.674s.package.jsondeclares no typecheck script. I rannpx tsc --noEmit -p tsconfig.json(exit 0) andnpm run build(exit 0, "Compiled successfully", TypeScript step finished).biome checkontranscript.tsxreports the same 2 errors and 14 warnings as onmain. None of them is on a changed line.Not verified
ask_operatorin a live task.