Skip to content

Report missing timeout DoS vulnerability in container execution#188

Open
Vaiditya2207 wants to merge 1 commit intomainfrom
sentinel-dos-report-11015010953051891038
Open

Report missing timeout DoS vulnerability in container execution#188
Vaiditya2207 wants to merge 1 commit intomainfrom
sentinel-dos-report-11015010953051891038

Conversation

@Vaiditya2207
Copy link
Copy Markdown
Owner

@Vaiditya2207 Vaiditya2207 commented Mar 19, 2026

I have updated SECURITY_ISSUE.md to report a CRITICAL Denial of Service vulnerability in syscore/src/docker/manager.rs where Docker container execution is awaited without a timeout (docker.wait_container). This allows an attacker to exhaust server resources by submitting non-terminating code payloads (e.g., infinite loops).

I also logged the learning in .jules/sentinel.md as required. No source code was modified, keeping to the Sentinel guidelines. The Rust backend tests passed successfully to ensure no regressions were introduced.


PR created automatically by Jules for task 11015010953051891038 started by @Vaiditya2207

Summary by CodeRabbit

Documentation

  • Updated security documentation to record an identified vulnerability related to container execution timeout handling and mitigation strategies.

Updates SECURITY_ISSUE.md to report a CRITICAL DoS vulnerability
caused by an unbounded wait on `docker.wait_container` in `syscore/src/docker/manager.rs`.
Also records the systemic cause in the auditor journal `.jules/sentinel.md`.
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
okernel Ready Ready Preview, Comment Mar 19, 2026 9:42pm

@github-actions github-actions Bot added documentation Improvements or additions to documentation source test ci labels Mar 19, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 19, 2026

📝 Walkthrough

Walkthrough

The PR updates documentation files to describe a Docker execution timeout vulnerability. The sentinel file receives a dated entry documenting the issue and proper line ending, while SECURITY_ISSUE.md is updated to replace a file write vulnerability description with a DoS vulnerability description related to unbounded container wait operations.

Changes

Cohort / File(s) Summary
Security Documentation
.jules/sentinel.md
Added dated vulnerability entry describing unbounded timeout in Docker container execution and fixed file line ending.
Vulnerability Report
SECURITY_ISSUE.md
Updated critical issue from arbitrary file write vulnerability to denial-of-service vulnerability caused by unbounded container execution. Replaced code snippet, impact description, and remediation steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

documentation

Poem

🐰 A rabbit's prose on Docker woes,
Where timeouts hide and peril grows,
No bounds to wait, resources fade,
Documentation comes to our aid!
With security warnings, clear and bright,
We'll patch these leaks and set things right! 🔒

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Report missing timeout DoS vulnerability in container execution' directly and clearly summarizes the main change: documenting a denial-of-service vulnerability caused by missing timeout in container execution, which matches the primary objective of updating security documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sentinel-dos-report-11015010953051891038
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@SECURITY_ISSUE.md`:
- Around line 27-49: The timeout handling needs to both stop and kill the
container when the wait_future (self.docker.wait_container::<String>(&id,
None).next()) exceeds the timeout_duration used with tokio::time::timeout;
update the Err(_) branch to first attempt self.docker.stop_container(&id,
None).await, then call self.docker.kill_container(&id, None).await to ensure
unresponsive containers are terminated, log both results (stop and kill), and
return an early error (e.g., Err("Execution timed out".to_string())) so callers
know the container was forcibly terminated.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d5722bfb-e6e6-4749-95a1-8d584c350903

📥 Commits

Reviewing files that changed from the base of the PR and between 0d72e5f and 2b30946.

📒 Files selected for processing (2)
  • .jules/sentinel.md
  • SECURITY_ISSUE.md

Comment thread SECURITY_ISSUE.md
Comment on lines +27 to +49
Implement a strict execution timeout on the `wait_container` future. If the container execution exceeds the timeout threshold (e.g., 5-10 seconds), explicitly stop and kill the container, and return a "Timeout exceeded" error.

Example fix:
Example fix using `tokio::time::timeout`:
```rust
let safe_filename = std::path::Path::new(&filename)
.file_name()
.and_then(|name| name.to_str())
.ok_or((StatusCode::BAD_REQUEST, "Invalid filename".to_string()))?;

let file_path = version_dir.join(safe_filename);
use std::time::Duration;

let timeout_duration = Duration::from_secs(5);
let wait_future = self.docker.wait_container::<String>(&id, None).next();

match tokio::time::timeout(timeout_duration, wait_future).await {
Ok(Some(Ok(res))) => {
tracing::debug!("[Job {}] Container exited with code {}", job_id, res.status_code);
}
Ok(_) => {
tracing::warn!("[Job {}] Wait failed or container crashed", job_id);
}
Err(_) => {
tracing::warn!("[Job {}] Execution timed out. Killing container.", job_id);
let _ = self.docker.stop_container(&id, None).await;
// Return an early error or handle the timeout condition
return Err("Execution timed out".to_string());
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Locate manager.rs =="
fd manager.rs

echo
echo "== Inspect wait_container call site and surrounding logic =="
rg -n -C4 'wait_container|/api/execute|next\(\)\.await|timeout\(' syscore/src/docker/manager.rs

echo
echo "== Inspect docker termination APIs used in repository =="
rg -n -C2 'stop_container|kill_container|remove_container' syscore/src/docker/manager.rs
rg -n -C2 'stop_container|kill_container|remove_container' --type rust

Repository: Vaiditya2207/OKernel

Length of output: 2090


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check Docker client type and imports in manager.rs =="
head -40 syscore/src/docker/manager.rs | grep -E 'use|Docker|bollard'

echo
echo "== Full imports section of manager.rs =="
rg '^use ' syscore/src/docker/manager.rs | head -20

echo
echo "== Check if stop_container or kill_container are used anywhere in the repo =="
rg 'stop_container|kill_container' --type rust

echo
echo "== Check Docker struct definition and available methods =="
rg 'struct.*Docker|impl.*Docker' syscore/src/docker/manager.rs

Repository: Vaiditya2207/OKernel

Length of output: 908


🌐 Web query:

bollard rust crate docker stop_container kill_container API methods

💡 Result:

The Bollard Rust crate provides asynchronous bindings to the Docker Engine API, including methods for managing Docker containers. Key API methods on the Docker struct for stopping and killing containers: - stop_container(&self, container_name: &str, options: Option) -> impl Future<Output = Result<, Error>> - Gracefully stops a container. The StopContainerOptions struct has a field t: i64 specifying seconds to wait before killing if it doesn't stop (default 30). - kill_container(&self, container_name: &str, options: Option<KillContainerOptions>) -> impl Future<Output = Result<, Error>> where T: Into + Serialize - Force-kills a container by sending a signal. KillContainerOptions has signal: Option (e.g., "SIGKILL"). Usage example: use bollard::{Docker, container::{StopContainerOptions, KillContainerOptions}}; let docker = Docker::connect_with_local_defaults.unwrap; docker.stop_container("my_container", Some(StopContainerOptions { t: 10 })).await?; docker.kill_container("my_container", Some(KillContainerOptions { signal: "SIGKILL".to_string })).await?; These methods correspond to Docker CLI docker stop and docker kill. Source docs confirm presence in container module and Docker impl (latest v0.20.1 as of 2026-02-01, Docker API v1.52).

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Read SECURITY_ISSUE.md lines 27-49 =="
sed -n '27,49p' SECURITY_ISSUE.md

echo
echo "== Check full context of wait_container implementation =="
sed -n '220,240p' syscore/src/docker/manager.rs

Repository: Vaiditya2207/OKernel

Length of output: 1993


Remediation text and code sample are inconsistent on container termination.

The documentation requires "explicitly stop and kill the container" but the code snippet only calls stop_container. For unresponsive containers, this leaves the container running and the DoS condition unresolved. Add kill_container after the stop attempt to match the stated intent.

Suggested doc fix
     Err(_) => {
          tracing::warn!("[Job {}] Execution timed out. Killing container.", job_id);
          let _ = self.docker.stop_container(&id, None).await;
+         let _ = self.docker.kill_container(&id, None).await;
          // Return an early error or handle the timeout condition
          return Err("Execution timed out".to_string());
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Implement a strict execution timeout on the `wait_container` future. If the container execution exceeds the timeout threshold (e.g., 5-10 seconds), explicitly stop and kill the container, and return a "Timeout exceeded" error.
Example fix:
Example fix using `tokio::time::timeout`:
```rust
let safe_filename = std::path::Path::new(&filename)
.file_name()
.and_then(|name| name.to_str())
.ok_or((StatusCode::BAD_REQUEST, "Invalid filename".to_string()))?;
let file_path = version_dir.join(safe_filename);
use std::time::Duration;
let timeout_duration = Duration::from_secs(5);
let wait_future = self.docker.wait_container::<String>(&id, None).next();
match tokio::time::timeout(timeout_duration, wait_future).await {
Ok(Some(Ok(res))) => {
tracing::debug!("[Job {}] Container exited with code {}", job_id, res.status_code);
}
Ok(_) => {
tracing::warn!("[Job {}] Wait failed or container crashed", job_id);
}
Err(_) => {
tracing::warn!("[Job {}] Execution timed out. Killing container.", job_id);
let _ = self.docker.stop_container(&id, None).await;
// Return an early error or handle the timeout condition
return Err("Execution timed out".to_string());
}
}
Err(_) => {
tracing::warn!("[Job {}] Execution timed out. Killing container.", job_id);
let _ = self.docker.stop_container(&id, None).await;
let _ = self.docker.kill_container(&id, None).await;
// Return an early error or handle the timeout condition
return Err("Execution timed out".to_string());
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@SECURITY_ISSUE.md` around lines 27 - 49, The timeout handling needs to both
stop and kill the container when the wait_future
(self.docker.wait_container::<String>(&id, None).next()) exceeds the
timeout_duration used with tokio::time::timeout; update the Err(_) branch to
first attempt self.docker.stop_container(&id, None).await, then call
self.docker.kill_container(&id, None).await to ensure unresponsive containers
are terminated, log both results (stop and kill), and return an early error
(e.g., Err("Execution timed out".to_string())) so callers know the container was
forcibly terminated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci documentation Improvements or additions to documentation source test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant