Commit Graph
1048 Commits
Author SHA1 Message Date
BaaRai b3c9375101 Merge pull request #354 from Coff0xc/fix/dsn-redact
fix(config): mask keyword-value and query DSN passwords
2026-11-19 14:25:37 +01:00
Coff0xc 7d28638980 fix(config): mask keyword-value and query DSN passwords
Redact only rewrote URL userinfo, so libpq keyword DSNs and
?password= query values reached ping-failure logs in full.
2026-11-19 14:25:24 +01:00
BaaRai 8f92caa042 Merge pull request #353 from Coff0xc/fix/dsl-nesting-limit
fix(db): bound asset DSL length and parenthesis depth
2026-11-19 14:25:18 +01:00
Coff0xc 16b04cfb48 fix(db): bound asset DSL length and parenthesis depth
ParseDSL recursed on every '(' with no depth or size cap, so a
query of nested parentheses could grow the goroutine stack until
the process died. Cap input at 4 KiB and nesting at 32.
2026-11-19 14:25:04 +01:00
BaaRai 432c882bca Merge pull request #352 from Coff0xc/fix/conv-messages-limit
fix(server): cap conversation message page size
2026-11-19 14:24:31 +01:00
Coff0xc bf6feefbdf fix(server): cap conversation message page size
GET /api/conversations/{id}/messages passed limit through to the
database with no upper bound, so a huge query could load the whole
transcript. Clamp history pages to 200 and keep the since tail at 1000.
2026-11-19 14:24:11 +01:00
BaaRai cdc39ed776 Merge pull request #351 from Coff0xc/fix/retry-after-overflow
fix(egress): reject overflowing Retry-After values
2026-11-19 14:23:56 +01:00
Coff0xc 7bbb0267e4 fix(egress): reject overflowing Retry-After values
strconv.Atoi accepted a huge Retry-After, then time.Duration(n)*Second
wrapped so the delay looked smaller than MaxDelay and the governor
retried immediately. Parse as int64 and refuse anything above MaxDelay.
2026-11-19 14:23:32 +01:00
BaaRai 05d320878b Merge pull request #285 from renaesop/codex/s3-task-archives
feat: add encrypted S3 archive storage backend
2026-11-19 14:23:12 +01:00
Chubboy Ren fa84c00202 Merge remote-tracking branch 'upstream/main' into codex/s3-task-archives 2026-11-19 03:33:51 +00:00
Chubboy Ren 3755e95504 fix: enforce archive encryption and clean failed S3 uploads 2026-11-19 03:33:51 +00:00
BaaRai 65045efae6 Merge pull request #335 from Coff0xc/fix/createdb-ident
fix(db): reject unsafe CREATE DATABASE identifiers
2026-11-18 22:43:54 +01:00
BaaRai 8110735aa7 fix(db): quote CREATE DATABASE name with pgx.Identifier
The allowlist rejected names PostgreSQL accepts, so an existing install
whose database name had a hyphen, a dot or non-ASCII characters refused
to start. pgx.Identifier escapes any name, which closes the injection
without refusing a name that already exists.
2026-11-18 22:43:30 +01:00
Coff0xc 437c0ff03e fix(db): reject unsafe CREATE DATABASE identifiers
ensureDatabase quoted the DSN path into CREATE DATABASE with no
check. A quote in the name could close the identifier. The name is
now restricted to the unquoted-identifier alphabet before quoting.
2026-11-18 22:43:20 +01:00
BaaRai 8f3a9a8413 Merge pull request #331 from Coff0xc/fix/browser-mcp-npx
fix(mcp): launch the browser MCP from playwright-mcp, not npx
2026-11-18 22:43:02 +01:00
BaaRai 5a4af1b4da fix(docker): install MCP chromium through its linked playwright-core
playwright-core's exports map does not expose ./cli.js, so
require.resolve threw inside the command substitution, the outer node
got an empty script path, and the build still succeeded without
installing chromium v1247. Run the binary npm links for @playwright/mcp
instead. Verified with docker build: both v1247 and v1248 are in the
cache, and @playwright/mcp's playwright-core launches 155.0.8059.12.
2026-11-18 22:42:38 +01:00
Coff0xc 3546ea0fff fix(mcp): rewrite npx -y and playwright-mcp rows missing --browser
The stock seed was npx @playwright/mcp, but the UI mock and common
invocations use npx -y, which the first pass left untouched. Also add
--browser chromium to a leftover playwright-mcp --headless row, resolve
the MCP's playwright-core CLI via require.resolve, and cover proxy-arg
stripping so capture sync does not depend on args[0].
2026-11-18 22:42:38 +01:00
Coff0xc f2666dbae2 fix(mcp): launch the browser MCP from playwright-mcp, not npx
npx @playwright/mcp queries the npm registry on every start even with
the package installed globally, so the image's pin did not decide what
ran and offline starts failed. Seed playwright-mcp --headless --browser
chromium, rewrite leftover stock npx rows once, and install the Chromium
build the MCP's own playwright-core expects.

Fixes #329
2026-11-18 22:42:25 +01:00
BaaRai b0e3851451 Merge pull request #344 from Coff0xc/fix/ingest-header-inject
fix(traffic): reject CR/LF in ingested methods and headers
2026-11-18 22:42:06 +01:00
Coff0xc 2352cfa7ed fix(traffic): reject CR/LF in ingested methods and headers
RecordExternal wrote method and header maps into req_head/resp_head
with no token or line-break check. Replay already refused those
values. An ingest JSON string with \r\n became extra evidence lines.

Apply the same validHeaderName and CR/LF/NUL checks before storage.
2026-11-18 22:41:42 +01:00
BaaRai 12211c467d Merge pull request #343 from Coff0xc/fix/change-password-limit
fix(server): rate-limit change-password guesses
2026-11-18 22:41:26 +01:00
Coff0xc 389825a683 fix(server): rate-limit change-password guesses
POST /api/auth/change-password checked the current password with bcrypt
and had no limiter. A stolen session could guess without backoff.

Reuse the login limiter, keyed by client IP and by the session token,
so rotating the source address with the same token still blocks.
A successful change clears both buckets.
2026-11-18 22:41:00 +01:00
BaaRai 83a1d17800 Merge pull request #342 from Coff0xc/fix/chat-session-id
fix(agent): reject unsafe ChatAgent session ids
2026-11-18 22:40:46 +01:00
Coff0xc 2a9743eb9e fix(agent): reject unsafe ChatAgent session ids
Chat joined sessionID into <workDir>/sessions with no allow-list, so
".." or a separator would escape that directory. Production callers
use conv-<id>, but the exported method accepted any string.

Accept only [A-Za-z0-9_-] up to 64 bytes, then confirm the cleaned
path still sits under sessions/.
2026-11-18 22:40:21 +01:00
BaaRai 48d6158ac2 Merge pull request #341 from Coff0xc/fix/asset-http-href
fix(web): only http(s) asset URLs become service hrefs
2026-11-18 22:40:05 +01:00
Coff0xc d1431cfdcd fix(web): only http(s) asset URLs become service hrefs
The Services tab wrote the stored asset URL into href with no scheme
check. A javascript: or data: value stored via insert_assets or the
asset API became a clickable link. Non-http(s) URLs now render as text.
2026-11-18 22:39:38 +01:00
BaaRai 3bbda778e6 Merge pull request #340 from Coff0xc/fix/csv-formula
fix(report): neutralize formula cells in findings CSV export
2026-11-18 22:39:19 +01:00
Coff0xc fde809dd0c fix(report): neutralize formula cells in findings CSV export
FindingsCSV wrote name, class, summary, and task text as-is. A value
starting with =, +, -, @, tab, or CR is evaluated as a formula when
the file is opened in Excel or LibreOffice. Those cells are now
prefixed with a single quote.
2026-11-18 17:06:00 +00:00
BaaRai d89cf781b7 Merge pull request #337 from Coff0xc/fix/ask-operator-image-path
fix(server): confine ask_operator image_path to the task directory
2026-11-18 17:32:46 +01:00
BaaRai b4b4ade5b4 Merge pull request #336 from Coff0xc/fix/insert-assets-fail-closed
fix(agent): refuse insert_assets when intercept rules cannot be loaded
2026-11-18 17:32:29 +01:00
BaaRai 92254a2835 Merge pull request #334 from Coff0xc/fix/blobrange-overflow
fix(traffic): bound BlobRange without overflowing int64
2026-11-18 17:32:13 +01:00
Coff0xc 203103360e fix(server): confine ask_operator image_path to the task directory
image_path was opened as a raw filesystem path, so any readable
png/jpg/jpeg/webp/gif on the host could be copied into the operator
transcript. The path is now resolved from the task working directory
and refused when it contains .. or EvalSymlinks outside that tree.
2026-11-18 17:22:42 +01:00
Coff0xc 20b278cf98 fix(agent): refuse insert_assets when intercept rules cannot be loaded
insert_assets swallowed ListAssetInterceptRules and
TaskInterceptRulesSplit errors and evaluated an empty rule set, which
allowed every asset. A load failure now refuses the whole call. The
tool result is generic; the driver error stays in the process log.
2026-11-18 17:22:36 +01:00
Coff0xc 74c9c17626 fix(traffic): bound BlobRange without overflowing int64
offset+length > size wraps when length is near MaxInt64, so the cap is
skipped and make([]byte, length) can exhaust memory. Compare length
against size-offset instead.
2026-11-18 17:22:13 +01:00
BaaRai b6b9284d3a Merge pull request #333 from Coff0xc/fix/pg-text-array-escape
fix(db): escape backslashes in PostgreSQL text[] literals
2026-11-18 17:22:04 +01:00
Coff0xc 7681bacb50 fix(db): escape backslashes in PostgreSQL text[] literals
marshalStringArray quoted double quotes but not backslashes. In a
Postgres array element a backslash escapes the following quote, so a
value such as x\",evil,\"y could close the current element and inject
another. Double backslashes first, matching marshalJSONBArray.
2026-11-18 17:09:04 +01:00
BaaRai 04964ac9c9 Merge pull request #332 from Coff0xc/fix/mcp-null-env
fix(mcp): keep MCP env a writable map when JSON is null
2026-11-18 17:08:06 +01:00
BaaRai 9b8ddf0610 Merge pull request #338 from Dev-next-gen/fix/llmpool-trimerr-utf8
fix(llmpool): keep trimmed provider errors on a rune boundary
2026-11-18 17:07:57 +01:00
Leo Camus 864a60d48b fix(llmpool): keep trimmed provider errors on a rune boundary
trimErr cut the error text at byte 300, which can split a multi-byte
character. The result is stored as llm_profile_health.last_error, and
PostgreSQL rejects the invalid UTF-8, so the breaker state of a profile
whose provider answers in Chinese is never persisted and the write is
retried every second.
2026-11-18 13:07:45 +00:00
Coff0xc 230a99c2b9 fix(mcp): keep MCP env a writable map when JSON is null
json.Unmarshal of JSON null into a map yields nil. syncBrowserMCPProxy
then assigned NODE_EXTRA_CA_CERTS under traffic capture and panicked,
including during NewManager on every restart once that row was stored.
2026-11-18 11:43:40 +00:00
BaaRai 230ba39dd5 Merge pull request #324 from cyberd4ch/docs/317-scope-distance-trusted-input
docs(security): document scope_distance as a trusted input
2026-11-18 12:26:26 +01:00
BaaRai 9767a70205 docs(security): name the real ingest counters and block rules
in_scope_not_asset counts in-scope events that are not asset types, not
gate rejects: a rejected candidate comes back as an insertion forbidden
error in the insert_assets result. EvaluateAssetGate also applies block
rules whether or not an allow-list exists, so the no-allow-list gap is
about the allow rule, not the whole gate.
2026-11-18 12:12:50 +01:00
BaaRai 366e14066f Merge pull request #322 from Dev-next-gen/fix/finding-filename-utf8
fix(report): keep finding zip names on a rune boundary
2026-11-18 12:12:23 +01:00
BaaRai 4c486e1c01 Merge pull request #328 from Michael-JRead/fix/surface-provider-refusals
fix: report provider refusals, do not rerun them as idle turns
2026-11-18 12:12:19 +01:00
Mike ReadandClaude Opus 5.5 03e216d032 fix: report provider refusals, do not rerun them as idle turns
A turn the provider's safety system declines (Anthropic stop_reason
"refusal", OpenAI-compatible finish_reason "content_filter") has no text
and no tool calls. Norma passes the stop reason through and the harness
ends any tool-less turn with ReasonCompleted, so the run summary said the
model "ended this turn normally", and steerHooks.Stop took the empty turn
for an idle one and resent the conversation up to the empty-response retry
count.

The LLM recorder is the one layer that sees the stop reason. It now hands
each completed call's stop reason to an optional context sink
(llmrec.WithStopSink). captureRunSession installs a per-run tracker
(agent.WithStopTracker) on that sink. With it:

- steerHooks.Stop does not inject the idle-turn rerun after a refusal;
- terminalText reports "provider refusal (stop_reason ...)" and says the
  intent was not completed, instead of the completed wording.

Other terminal states and ordinary empty turns are unchanged.

Fixes #327

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 00:41:18 -06:00
dach-a 94be0148ce docs(security): document scope_distance as a trusted input
States the trust boundary discussed in #317:

- output.json's scope_distance is the integrated scanner's own verdict
  and is ingested as-is; in-scope events are not re-checked against
  ARTEX's rule set.
- The enforced boundary is the task allow-list: assets reach the graph
  (insert_assets) only through EvaluateAssetGate, and rejects are
  recorded as in_scope_not_asset.
- The no-allow-list case is an accepted gap, with operator guidance:
  configure an allow-list per task or review output.json before feeding
  it to ARTEX. Cross-checking ingested events against ARTEX's rule set
  would redefine existing scanner configurations, so it is a deliberate
  design question, not an accepted vulnerability.

Option 2 as picked on #317; documentation only.
2026-11-18 03:15:57 +00:00
Leo Camus 88aefa0fc3 fix(report): keep finding zip names on a rune boundary
FindingFilename cut the name at 120 bytes, which can split a multi-byte
character. archive/zip only sets the UTF-8 flag on valid names, so the
entry was written without it and unzip tools decoded the whole name as
CP437, garbling every non-ASCII character in it.
2026-11-18 02:37:26 +00:00
BaaRai 51e2c603b9 Merge pull request #282 from renaesop/codex/fix-record-fact-input-contract
fix: repair record_fact summary contracts and asset aliases
2026-11-18 03:30:48 +01:00
Chubboy Ren a40781ae1f refactor: split archive backend from server and UI integration 2026-11-18 02:05:17 +00:00
Chubboy Ren da7cc62d4e feat: encrypt S3 archives and test credentials and interruption recovery 2026-11-18 02:05:17 +00:00