Repository navigation
Description
Summary
Follow-up from #35447 (per-session isolation for cron operations). While implementing session-scoped filtering for cron.list, cron.remove, cron.update, and cron.run, we identified that cron.runs with scope === "all" still leaks job names from other agents/sessions.
Current Behavior
In src/gateway/server-methods/cron.ts, the cron.runs handler (around line 320) builds a jobNameById map by calling context.cron.list({ includeDisabled: true }) — the non-paginated list() method which does not apply caller-based filtering. This means:
- The
jobNameByIdmap contains names of all jobs from all agents/sessions - These names are injected into the run log entries returned to the caller
- A user can see the names of cron jobs belonging to other users
Expected Behavior
When cron.runs is called with scope === "all", the jobNameById map should only contain jobs visible to the calling session (consistent with the filtering applied by cron.list after #35447).
Suggested Fix
Apply the same caller-based filtering from listPage() (introduced in PR #49174) to the list() call inside the cron.runs handler. The resolveCronCallerOptions() helper already exists and can be reused.
Context
- Related PR: fix: enforce per-session isolation for cron job visibility and mutations #49174 (fix: enforce per-session isolation for cron job visibility and mutations)
- Related issue: [Feature]:
crontool: add per-agent/session isolation for job visibility and mutations #35447 - The run logs themselves were already globally accessible before [Feature]:
crontool: add per-agent/session isolation for job visibility and mutations #35447 — this issue is specifically about job name leakage in those logs
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
Hollychou924 commentedon Mar 17, 2026
fix: prevent cross-session job name leakage in cron.runs scope=all
clawsweeper commentedon Apr 28, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main fixes the reported disclosure: agent-scoped callers now carry trusted Gateway caller identity and
cron.runsrejects all-scope history before the unfiltered job-name map can run. The fix is merged on main through #96883 but is not in the latest release tag yet.I found the merged PR that appears to have closed this: #96883: Scope agent cron operations to the calling agent.
Root-cause cluster
Relationship:
canonicalCanonical: #49175
Summary: This issue is the canonical report for the
cron.runsall-scope job-name leak; current main fixes it, and the older open PR is superseded.Members:
fixed_by_candidate: Scope agent cron operations to the calling agent #96883 - The merged PR scopes agent cron operations to trusted caller identity and contains the current-main guard that prevents caller-scoped all-scope name enrichment.superseded: fix(cron): scope all-run job names #80146 - The open PR targets the same leak with a caller-suppliedagentIdapproach, but it is conflicting and current main now has a merged fix.partial_overlap: [Feature]:crontool: add per-agent/session isolation for job visibility and mutations #35447 - That closed issue tracked broader cron per-session isolation; this report focused on a remaining all-scope run-history name leak.partial_overlap: [Feature]: Isolated cron scheduled jobs per agent (per-agent jobs.json) in multi-user deployments #26370 - That open issue tracks broader per-agent cron storage and CRUD isolation, while this issue is limited to all-scope run-history job-name enrichment.adjacent_distinct: Add persistent cron job execution history with filtering #13601 - That open issue is about persistent cron execution history and filtering, not the same cross-session job-name disclosure.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the current-main trusted caller-scope implementation and retire the older conflicting linked fix PR separately if maintainer cleanup is authorized.
Do we have a high-confidence way to reproduce the issue?
No current-main reproduction remains. Source inspection shows caller-scoped all-scope history is rejected and the regression test verifies the old unfiltered list path is not called.
Is this the best way to solve the issue?
Yes. The current-main fix is the safer solution because it derives scope from trusted Gateway agent runtime identity and rejects caller-scoped all-scope history instead of trusting a caller-supplied agent id.
Security review:
Security review cleared: Current main blocks the reported cross-session cron job-name disclosure for agent-scoped callers; no remaining issue-wide security concern was found in the reviewed path.
AGENTS.md: found and applied where relevant.
What I checked:
cron.runsreads the Gateway client's agent runtime identity, rejectsscope: "all"when a caller scope exists, and returns before calling the unfilteredcontext.cron.list({ includeDisabled: true })name-enrichment path. (src/gateway/server-methods/cron.ts:964, c5d34c8376f8)cron.runsall-scope history returnsscope all is not allowed by caller scopeand thatcontext.cron.listis not called. (src/gateway/server-methods/cron.validation.test.ts:1456, c5d34c8376f8)git blameattributes the caller-scope read and all-scope rejection in the current handler tocee2aca4091265288ce1351b2c97e1f02a2e6dad. (src/gateway/server-methods/cron.ts:973, cee2aca40912)cee2aca4091265288ce1351b2c97e1f02a2e6dadand its body documents agent-tool cron calls being limited to the calling agent, with cross-agent history and mutation attempts rejected. (cee2aca40912)cee2aca4091265288ce1351b2c97e1f02a2e6dad, committed at2026-06-26T21:41:14-05:00, with subjectScope agent cron operations to the calling agent (#96883). (cee2aca40912)git merge-base --is-ancestorreturned1forv2026.6.10; this is fixed on current main only, not in latest releasev2026.6.10. (cee2aca40912)Likely related people:
cron.runsall-scope rejection and regression tests. (role: recent area contributor; confidence: high; commits: cee2aca40912; files:src/gateway/server-methods/cron.ts,src/gateway/server-methods/cron.validation.test.ts)src/gateway/server-methods/cron.ts,src/cron/run-log.ts)cron.runsjob-name enrichment through the same Gateway and run-log reader path. (role: recent adjacent contributor; confidence: medium; commits: c213827aa50b; files:src/gateway/server-methods/cron.ts,src/cron/run-log.test.ts,src/gateway/server.cron.test.ts)Codex review notes: model internal, reasoning high; reviewed against c5d34c8376f8; fix evidence: merged PR #96883, commit cee2aca40912, main fix timestamp 2026-06-26T21:41:14-05:00.
openclaw-barnacle commentedon Jun 8, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.