CVE 2024 23897 jenkins cli - #1517
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
Summary by CodeRabbit
WalkthroughAdds a new YAML vulnerability rule that detects Jenkins CVE-2024-23897 by POSTing Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
nettacker/modules/vuln/jenkins_cve_2024_23897.yaml (1)
42-54: Linux-only file probe can miss vulnerable Windows Jenkins instances.Using only
help@/etc/passwd`` limits detection coverage. Consider adding a second probe (e.g.,@C:\Windows\win.ini) so vulnerable Windows deployments are also detected.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nettacker/modules/vuln/jenkins_cve_2024_23897.yaml` around lines 42 - 54, The probe currently sends "help `@/etc/passwd`" which only detects Linux Jenkins; update the vulnerability probe in jenkins_cve_2024_23897.yaml to also test a Windows-specific file (e.g., send a second probe with "help `@C`:\Windows\win.ini" or include both payloads) and adjust the response matching logic (the `response.conditions.content.regex` or add a separate response entry) to accept either Linux indicators ("root:x:0|daemon:x:1") or Windows indicators from win.ini so Windows instances are detected as well.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nettacker/modules/vuln/jenkins_cve_2024_23897.yaml`:
- Around line 17-22: The HTTP step that currently shows method: post with
headers.User-Agent and Content-Type needs an explicit ssl field to avoid
ambiguous transport—add ssl: true (or ssl: false if this target is known
plaintext) directly under the step alongside timeout, and ensure the rule's info
block includes a reference: entry (e.g., info.reference: "CVE-2024-23897" or a
vendor advisory) so the file jenkins_cve_2024_23897.yaml contains
headers.User-Agent: "{user_agent}", an explicit ssl setting, and an
info.reference value.
---
Nitpick comments:
In `@nettacker/modules/vuln/jenkins_cve_2024_23897.yaml`:
- Around line 42-54: The probe currently sends "help `@/etc/passwd`" which only
detects Linux Jenkins; update the vulnerability probe in
jenkins_cve_2024_23897.yaml to also test a Windows-specific file (e.g., send a
second probe with "help `@C`:\Windows\win.ini" or include both payloads) and
adjust the response matching logic (the `response.conditions.content.regex` or
add a separate response entry) to accept either Linux indicators
("root:x:0|daemon:x:1") or Windows indicators from win.ini so Windows instances
are detected as well.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: fdf99cf9-ec0c-4f4a-bd87-89a6913a46e2
📒 Files selected for processing (1)
nettacker/modules/vuln/jenkins_cve_2024_23897.yaml
| - method: post | ||
| timeout: 3 | ||
| headers: | ||
| User-Agent: "{user_agent}" | ||
| Content-Type: "text/plain" | ||
|
|
There was a problem hiding this comment.
Add explicit ssl on the HTTP step.
Line 17–22 defines the HTTP step without an explicit ssl field. Please set it explicitly to avoid ambiguous transport behavior across targets.
Suggested patch
- method: post
timeout: 3
+ ssl: false
headers:
User-Agent: "{user_agent}"
Content-Type: "text/plain"Based on learnings: “Every HTTP step must include headers.User-Agent: "{user_agent}", ssl:, and the info block must include reference:.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@nettacker/modules/vuln/jenkins_cve_2024_23897.yaml` around lines 17 - 22, The
HTTP step that currently shows method: post with headers.User-Agent and
Content-Type needs an explicit ssl field to avoid ambiguous transport—add ssl:
true (or ssl: false if this target is known plaintext) directly under the step
alongside timeout, and ensure the rule's info block includes a reference: entry
(e.g., info.reference: "CVE-2024-23897" or a vendor advisory) so the file
jenkins_cve_2024_23897.yaml contains headers.User-Agent: "{user_agent}", an
explicit ssl setting, and an info.reference value.
| severity: 7.5 | ||
| description: Detects Jenkins CVE-2024-23897 arbitrary file read via CLI argument parsing using @file syntax. | ||
| reference: | ||
| - https://www.jenkins.io/security/advisory/2024-01-24/ |
There was a problem hiding this comment.
There was a problem hiding this comment.
Thank you for the guidance @securestep9. I have added the missing profiles and updated the module accordingly.
| - vuln | ||
| - jenkins | ||
| - cve | ||
|
|
There was a problem hiding this comment.
@Prajwal5755 high_severity and cisa_kev profiles missing. Please study existing Nettacker modules to understand which profiles you need
There was a problem hiding this comment.
Thank you for the guidance @securestep9. I have added the missing profiles and updated this module. I will also update my other modules accordingly.
| help @/etc/passwd | ||
|
|
||
| response: | ||
| log: "Confirmed CVE-2024-23897 vulnerability detected" |
There was a problem hiding this comment.
no need to log anything - Nettacker vuln modules will automatically log 'Detected' against this module
There was a problem hiding this comment.
Thank you for guidance @securestep9 , I have removed log now
|
@Prajwal5755 also please remember to update the documentation and add this module to Modules.md |
|
Hi @securestep9, I couldn’t find Modules.md in the repository. Could you please confirm the correct location where I should add this module? or should i need to create file Modules.md? |
|
And also I have updated profiles , log and regex in other modules accordingly including pr 1414 and 1437 |
Documentation is under |
|
Hi @securestep9, I’ve added the module entry to Modules.md and updated the documentation as suggested. Thanks for pointing me to the correct location. Please let me know if anything else needs improvement. |
Bumps [flask](https://github.com/pallets/flask) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/pallets/flask/releases) - [Changelog](https://github.com/pallets/flask/blob/main/CHANGES.rst) - [Commits](pallets/flask@3.1.2...3.1.3) --- updated-dependencies: - dependency-name: flask dependency-version: 3.1.3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
Hi @securestep9, I’ve addressed all the requested changes including documentation and Modules.md updates. Could you please review it again when you have time? |
|
@codex review this PR using skill: https://github.com/nettacker-codex-ai/skills/blob/main/pr-review-recommender/SKILL.md |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b26696a72
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| data: | | ||
| help @/etc/passwd |
There was a problem hiding this comment.
Send a valid Jenkins CLI protocol exchange
On a real vulnerable Jenkins instance, /cli does not interpret a text/plain request body as command-line arguments. The HTTP CLI transport requires paired upload/download requests with a shared session, Side headers, and CLI-framed binary arguments; HttpEngine sends this as one ordinary POST. Consequently, help @/etc/passwd is never executed and the content matcher cannot observe the file contents, making this module consistently return false negatives.
Useful? React with 👍 / 👎.
| profiles: | ||
| - vuln |
There was a problem hiding this comment.
Include the module in the HTTP profile
When users scan with --profile http, this module is omitted because profile resolution in ArgParser.load_profiles relies exclusively on the entries in info.profiles, and this list lacks http. It is also the only vulnerability module using the HTTP library without that profile tag, so HTTP-profile scans will unexpectedly skip the new Jenkins check.
Useful? React with 👍 / 👎.
| data: | | ||
| help @/etc/passwd |
There was a problem hiding this comment.
Probe a file that exists on Windows hosts
When the vulnerable Jenkins controller runs on Windows, /etc/passwd does not exist, so even after the CLI request is encoded correctly this probe produces no matching file content and reports a false negative. CVE-2024-23897 is not limited to Unix installations; add a Windows-specific file probe and response marker alongside the Unix check.
Useful? React with 👍 / 👎.
|
|
||
| url: | ||
| nettacker_fuzzer: | ||
| input_format: "{{schema}}://{target}:{{ports}}{{path}}" |
There was a problem hiding this comment.
Honor the target's Jenkins context path
When a user supplies a target such as https://host/jenkins, Nettacker.expand_targets removes /jenkins from the hostname and stores it in url_base_path, but this URL template never inserts that value. The request therefore goes to /cli instead of /jenkins/cli, causing false negatives for Jenkins installations deployed under a context path even when the user provided the correct application URL.
Useful? React with 👍 / 👎.
|
Hi @securestep9, |
Proposed change
Your PR description goes here:
Added detection module for CVE-2024-23897 (Jenkins CLI Arbitrary File Read)
This PR adds a new module to detect CVE-2024-23897 in Jenkins.
The vulnerability is caused by improper handling of the @file syntax in the Jenkins CLI, allowing arbitrary file reads. The module sends a crafted POST request to the /cli endpoint with the payload help @/etc/passwd and checks for indicators such as root:x:0: in the response.
The module was tested locally using a simulated vulnerable environment to validate detection.
Type of change
Checklist
make pre-commitand confirm it didn't generate any warnings/changesmake testand I confirm all tests passed locallydocs/folder