<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Open Source on Svtter's Blog</title><link>https://svtter.cn/en/tags/open-source/</link><description>Recent content in Open Source on Svtter's Blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 23 Dec 2025 15:00:00 +0800</lastBuildDate><atom:link href="https://svtter.cn/en/tags/open-source/index.xml" rel="self" type="application/rss+xml"/><item><title>Developing Fried Rice Theme with Claude Code</title><link>https://svtter.cn/en/p/developing-fried-rice-theme-with-claude-code/</link><pubDate>Tue, 23 Dec 2025 15:00:00 +0800</pubDate><guid>https://svtter.cn/en/p/developing-fried-rice-theme-with-claude-code/</guid><description>&lt;img src="https://svtter.cn/p/%E7%94%A8-claude-code-%E5%BC%80%E5%8F%91-fried-rice-%E4%B8%BB%E9%A2%98/pics/bg.png" alt="Featured image of post Developing Fried Rice Theme with Claude Code" /&gt;&lt;p&gt;Recently, I used Claude Code to add some SEO features to my own blog theme &lt;a class="link" href="https://github.com/Svtter/Fried-Rice" target="_blank" rel="noopener"
&gt;Fried Rice&lt;/a&gt;, and the overall experience was quite good.&lt;/p&gt;
&lt;h2 id="background"&gt;Background
&lt;/h2&gt;&lt;p&gt;Fried Rice is a theme forked from &lt;a class="link" href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener"
&gt;hugo-theme-stack&lt;/a&gt;. Previously, I had already added some basic JSON-LD structured data, and this time I wanted to continue improving it.&lt;/p&gt;
&lt;h2 id="what-was-done-this-time"&gt;What Was Done This Time
&lt;/h2&gt;&lt;p&gt;Mainly enhancing SEO structured data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;WebSite schema (supports search action)&lt;/li&gt;
&lt;li&gt;Organization schema (includes founder, contact point, address)&lt;/li&gt;
&lt;li&gt;FAQ schema (supports inline FAQ in articles)&lt;/li&gt;
&lt;li&gt;Enhanced Article/BlogPosting schema (added accessibility metadata)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="https://svtter.cn/p/%E7%94%A8-claude-code-%E5%BC%80%E5%8F%91-fried-rice-%E4%B8%BB%E9%A2%98/pics/screen.png"
width="2153"
height="1761"
srcset="https://svtter.cn/p/%E7%94%A8-claude-code-%E5%BC%80%E5%8F%91-fried-rice-%E4%B8%BB%E9%A2%98/pics/screen_hu_9e208084f399dd3b.png 480w, https://svtter.cn/p/%E7%94%A8-claude-code-%E5%BC%80%E5%8F%91-fried-rice-%E4%B8%BB%E9%A2%98/pics/screen_hu_ddc5a242949e5593.png 1024w"
loading="lazy"
alt="Fried Rice Theme Preview"
class="gallery-image"
data-flex-grow="122"
data-flex-basis="293px"
&gt;&lt;/p&gt;
&lt;h2 id="claude-codes-performance"&gt;Claude Code&amp;rsquo;s Performance
&lt;/h2&gt;&lt;p&gt;The entire development process took about 2 hours. Claude Code helped me:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Write code&lt;/strong&gt; - Hugo template syntax is cumbersome, letting AI write it saves a lot of effort&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Review code&lt;/strong&gt; - After I committed, I asked it to check, and it found several issues:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;datePublished&lt;/code&gt; was defined 3 times&lt;/li&gt;
&lt;li&gt;&lt;code&gt;founder&lt;/code&gt; object was defined repeatedly&lt;/li&gt;
&lt;li&gt;JSON output had double escaping issues&lt;/li&gt;
&lt;li&gt;Variable scope errors&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fix issues&lt;/strong&gt; - After finding issues, I asked it to fix them directly, all fixed at once&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Create PR, tag, write CHANGELOG&lt;/strong&gt; - These trivial tasks can also be done&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A pleasant surprise was that it could find logical issues in the code. For example, Hugo&amp;rsquo;s &lt;code&gt;jsonify&lt;/code&gt; output was HTML-escaped causing JSON format errors, and it found the correct solution (using &lt;code&gt;safeJS&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id="shortcomings"&gt;Shortcomings
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;Sometimes needs multiple reminders to use the correct tools&lt;/li&gt;
&lt;li&gt;Not very familiar with Hugo template syntax in some places, needs several iterations&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="summary"&gt;Summary
&lt;/h2&gt;&lt;p&gt;For this kind of &amp;ldquo;add feature + fix bug&amp;rdquo; task, Claude Code is quite useful. Especially for tedious syntax like Hugo templates, having AI write it is much more efficient.&lt;/p&gt;
&lt;h2 id="related-projects"&gt;Related Projects
&lt;/h2&gt;
&lt;script src="https://svtter.cn/js/repo-card.js"&gt;&lt;/script&gt;&lt;div class="repo-card" data-repo="Svtter/Fried-Rice"&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Based on:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="repo-card" data-repo="CaiJimmy/hugo-theme-stack"&gt;&lt;/div&gt;</description></item><item><title>Use Emerging Open Source Software with Caution</title><link>https://svtter.cn/en/p/use-emerging-open-source-software-with-caution/</link><pubDate>Sat, 13 Dec 2025 11:02:40 +0800</pubDate><guid>https://svtter.cn/en/p/use-emerging-open-source-software-with-caution/</guid><description>&lt;img src="https://svtter.cn/p/%E8%B0%A8%E6%85%8E%E4%BD%BF%E7%94%A8%E6%96%B0%E5%85%B4%E5%BC%80%E6%BA%90%E8%BD%AF%E4%BB%B6/pics/background.png" alt="Featured image of post Use Emerging Open Source Software with Caution" /&gt;&lt;p&gt;Recently, I had an incident with Dify/Langchain and reached this conclusion.&lt;/p&gt;
&lt;h2 id="retrospective"&gt;Retrospective
&lt;/h2&gt;&lt;p&gt;About 7 months ago, I deployed the open-source Dify to the server and started an instance through the official docker compose. However, recently, due to a sandbox escape vulnerability in Dify&amp;rsquo;s code node (CVE-2025-3466), I was privilege-escalated via webshell and had a Monero mining program implanted.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://svtter.cn/p/%E8%B0%A8%E6%85%8E%E4%BD%BF%E7%94%A8%E6%96%B0%E5%85%B4%E5%BC%80%E6%BA%90%E8%BD%AF%E4%BB%B6/pics/danger-ip.png"
width="2553"
height="462"
srcset="https://svtter.cn/p/%E8%B0%A8%E6%85%8E%E4%BD%BF%E7%94%A8%E6%96%B0%E5%85%B4%E5%BC%80%E6%BA%90%E8%BD%AF%E4%BB%B6/pics/danger-ip_hu_6b9d32fdd11c794d.png 480w, https://svtter.cn/p/%E8%B0%A8%E6%85%8E%E4%BD%BF%E7%94%A8%E6%96%B0%E5%85%B4%E5%BC%80%E6%BA%90%E8%BD%AF%E4%BB%B6/pics/danger-ip_hu_1cc30a9f8660048.png 1024w"
loading="lazy"
class="gallery-image"
data-flex-grow="552"
data-flex-basis="1326px"
&gt;&lt;/p&gt;
&lt;p&gt;Fortunately, after this privilege escalation, the intruder didn&amp;rsquo;t do much, and the intrusion was in the docker container, with limited damage.&lt;/p&gt;
&lt;h2 id="cve-2025-3466-details"&gt;CVE-2025-3466 Details
&lt;/h2&gt;&lt;p&gt;&lt;strong&gt;CVE ID&lt;/strong&gt;: CVE-2025-3466
&lt;strong&gt;Release Date&lt;/strong&gt;: July 7, 2025
&lt;strong&gt;CVSS Score&lt;/strong&gt;: 9.8 (Critical)
&lt;strong&gt;Affected Versions&lt;/strong&gt;: langgenius/dify 1.1.0 - 1.1.2
&lt;strong&gt;Fixed Version&lt;/strong&gt;: 1.1.3&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vulnerability Description&lt;/strong&gt;:
Dify&amp;rsquo;s code node has a sandbox escape vulnerability, allowing attackers to bypass sandbox security restrictions by overwriting global JavaScript functions (such as &lt;code&gt;parseInt&lt;/code&gt;), thereby executing arbitrary code with full root privileges.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Attack Flow&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Attacker crafts malicious payload in the code node&amp;rsquo;s input&lt;/li&gt;
&lt;li&gt;Malicious code overwrites global JavaScript functions before sandbox restrictions are enforced&lt;/li&gt;
&lt;li&gt;Uses the overwritten functions to bypass security checks&lt;/li&gt;
&lt;li&gt;Executes arbitrary commands, gaining complete control of the container&lt;/li&gt;
&lt;li&gt;Implants webshell backdoor and Monero mining program&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;Impact Scope&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Unauthorized access to secret keys and API keys&lt;/li&gt;
&lt;li&gt;Access to internal network servers&lt;/li&gt;
&lt;li&gt;Lateral movement within the dify.ai system&lt;/li&gt;
&lt;li&gt;Complete takeover of server control&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Related Links&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://nvd.nist.gov/vuln/detail/cve-2025-3466" target="_blank" rel="noopener"
&gt;NVD Details&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/advisories/GHSA-x53g-q9xm-rf4m" target="_blank" rel="noopener"
&gt;GitHub Advisory GHSA-x53g-q9xm-rf4m&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;From this perspective, several key factors are indispensable for protecting server security.&lt;/p&gt;
&lt;h2 id="personal-server-security"&gt;Personal Server Security
&lt;/h2&gt;&lt;p&gt;From a security perspective, there are several things that must be done on personal servers. The first thing is to avoid using passwords as much as possible. For example, SSH passwords.&lt;/p&gt;
&lt;h3 id="ssh-passwords"&gt;SSH Passwords
&lt;/h3&gt;&lt;p&gt;Password login must be disabled. SSH password cracking is relatively easy. If the password is simple, or if the user changes the password themselves and uses a simple password, the server will be breached.&lt;/p&gt;
&lt;p&gt;If using Debian/Linux, disabling password login and disabling root login are mandatory:&lt;/p&gt;
&lt;p&gt;The fewer software packages used, the narrower the attacker&amp;rsquo;s attack surface. Once only nginx is exposed on your server, and port 80 and port 22 (SSH) are not open, the attacker&amp;rsquo;s attack surface is limited to nginx-related content.&lt;/p&gt;
&lt;h3 id="use-rootless-docker"&gt;Use Rootless Docker
&lt;/h3&gt;&lt;p&gt;Using container technology is equivalent to further virtualizing on top of the cloud service provider&amp;rsquo;s infrastructure.&lt;/p&gt;
&lt;p&gt;Using rootless docker can further limit container permissions. Even if the container is breached, the attacker cannot directly gain root privileges on the host. This is the last line of defense.&lt;/p&gt;
&lt;h3 id="limit-container-network-access"&gt;Limit Container Network Access
&lt;/h3&gt;&lt;p&gt;Most services don&amp;rsquo;t need unrestricted external network access permissions. Reasonably configuring container network policies to limit unnecessary network access can greatly reduce the attack surface.&lt;/p&gt;
&lt;p&gt;For example, many services only need to access databases or internal services, and don&amp;rsquo;t need to access the external network at all. If the container doesn&amp;rsquo;t have external network access permissions, even if breached, the attacker cannot download mining programs or communicate with C2 servers.&lt;/p&gt;
&lt;h2 id="how-to-use-open-source-software-with-caution"&gt;How to Use Open Source Software with Caution
&lt;/h2&gt;&lt;p&gt;This incident made me reflect on the following points when using emerging open source software:&lt;/p&gt;
&lt;h3 id="choose-mature-projects"&gt;Choose Mature Projects
&lt;/h3&gt;&lt;p&gt;Look at the project&amp;rsquo;s star count, commit frequency, and issue handling status. If a project:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Has few stars (less than a few hundred)&lt;/li&gt;
&lt;li&gt;Hasn&amp;rsquo;t been updated in recent months&lt;/li&gt;
&lt;li&gt;Has a large number of unresolved issues&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Then the risk of using this project is high.&lt;/p&gt;
&lt;h3 id="audit-dependencies"&gt;Audit Dependencies
&lt;/h3&gt;&lt;p&gt;Open source software often depends on a large number of third-party libraries. Like Dify in this incident, there was a serious code node sandbox escape vulnerability. Before deployment, it&amp;rsquo;s best to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Look at the project&amp;rsquo;s dependency tree&lt;/li&gt;
&lt;li&gt;Check for known vulnerabilities&lt;/li&gt;
&lt;li&gt;Regularly update dependencies&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="regular-updates-and-security-scanning"&gt;Regular Updates and Security Scanning
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Regularly check CVE databases&lt;/li&gt;
&lt;li&gt;Use tools like &lt;code&gt;snyk&lt;/code&gt;, &lt;code&gt;trivy&lt;/code&gt; for dependency vulnerability scanning&lt;/li&gt;
&lt;li&gt;Update to fixed versions in a timely manner&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="limit-permissions"&gt;Limit Permissions
&lt;/h3&gt;&lt;p&gt;Even if you trust a certain open source software, you should give it minimal permissions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Don&amp;rsquo;t give containers privileged permissions&lt;/li&gt;
&lt;li&gt;Limit container resource usage (CPU, memory)&lt;/li&gt;
&lt;li&gt;Use read-only file systems (if possible)&lt;/li&gt;
&lt;li&gt;Don&amp;rsquo;t mount the host&amp;rsquo;s sensitive directories into the container&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="monitoring-and-alerting"&gt;Monitoring and Alerting
&lt;/h2&gt;&lt;p&gt;Security is a continuous process, can&amp;rsquo;t rely solely on prevention. Establishing comprehensive monitoring and alerting mechanisms is crucial:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Monitor system resource usage (CPU, memory, disk IO anomalies may indicate mining programs)&lt;/li&gt;
&lt;li&gt;Monitor network traffic (abnormal outbound connections)&lt;/li&gt;
&lt;li&gt;Monitor process list (abnormal processes)&lt;/li&gt;
&lt;li&gt;Set up log alerts (e.g., failed login attempts)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;Open source software provides us with great convenience, but also brings security risks. Although this incident didn&amp;rsquo;t cause much loss, it gave me an important lesson:&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t blindly trust any software, especially emerging open source projects. Do more investigation before use, give minimal permissions during use, and continuously monitor and update after use.&lt;/p&gt;
&lt;p&gt;Server security is not a one-time solution, but requires continuous attention and maintenance.&lt;/p&gt;</description></item></channel></rss>