hermes - 💡(How to fix) Fix [workflow-engine] MEDIUM: workflow_run rate limit bypassable via concurrent calls (TOCTOU)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix

Reserve the slot before the await (append timestamp, then run; roll back on failure), or guard the check-and-append with an asyncio.Lock keyed per session.


Filed from opus-4.8 plugin audit (workflow-engine).

RAW_BUFFERClick to expand / collapse

Severity: MEDIUM (correctness, rate-limit bypass / TOCTOU)

workflow_run per-session rate limit is bypassable via concurrent calls.

Evidence

plugins/workflow-engine/tools/run_workflow.py:124-137, 183-184 — the _check_rate read of _rate_buckets and the timestamp append (line 184) are separated by await engine.start_run(...). Two concurrent workflow_run calls for the same session both pass the cap before either appends. The module-global dict has no lock.

Impact

run_rate_per_session (default 5/min) is not enforced under concurrency — a session can exceed the cap by issuing parallel tool calls.

Fix

Reserve the slot before the await (append timestamp, then run; roll back on failure), or guard the check-and-append with an asyncio.Lock keyed per session.


Filed from opus-4.8 plugin audit (workflow-engine).

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING