Skip to main content
Code Security

Qoder Security User Practices

Qoder Security User Practices
Explore the complete workflow from risk identification and path analysis to remediation and re-verification through five reproducible development scenarios. Many security issues don't manifest as a single obvious line of "dangerous code." User-controllable data may pass through multiple functions and modules before reaching network requests, file operations, database queries, or system commands. Looking at any single file in isolation often makes it difficult to reconstruct the complete risk path. If security checks only happen after code commits or delivery, developers not only need to re-enter the code context but also switch back and forth between alerts, localization, remediation, and verification. Qoder Security shifts security analysis forward to the coding stage, allowing requirement implementation, security checks, and issue remediation to be completed continuously within the same development context. This article selects five typical development tasks, providing designated projects and code versions, ready-to-use prompts, a unified trigger method, and clear observation points to help developers understand what Qoder Security is, which scenarios it applies to, and how to complete a full practice from risk discovery to remediation re-verification.
Product support scope Qoder Security will be available first in Qoder Desktop and Qoder CLI, with other Qoder products following. Specific capabilities and availability are subject to each product's release notes.

What Is Qoder Security

Qoder Security is the code security capability that Qoder provides for AI coding workflows. During the process of Qoder Agent writing or modifying code, it uses static checks, code semantic analysis, and cross-file data flow tracking to help identify potential security risks and provide risk locations, propagation paths, and assessment rationale related to the code. Qoder Security supports different levels of security analysis through three layers:
Detection LevelAnalysis MethodPrimary Function
Static CheckHigh-risk pattern and rule matchingQuickly identify dangerous functions, hardcoded keys, and other clear risks
Lightweight ScanSemantic analysis of incremental changesDetermine how external inputs enter network requests, database queries, or sensitive operations
Deep ScanCross-file, cross-function data flow trackingIdentify complete risk paths that are difficult to discover in a single file
Static checks can run automatically after code generation or tool execution. The system suggests lightweight or deep scans at key points such as near task completion, before code commits, or before pushes, with user confirmation required. To unify the practice path in this article, all five practices use /security-scan to actively initiate security scans. After discovering issues, developers can continue to have the Agent analyze and modify code within the current session, then run scans again to re-verify remediation results. This way, security feedback can extend from a single alert to a complete workflow of "discover — understand — fix — re-verify." Qoder Security provides proactive security checks for the coding stage, complementing manual code reviews, professional penetration testing, SAST, SCA, and existing organizational security governance processes — not replacing them.

Before You Begin

This article covers five common security boundaries:
PracticeNormal Development NeedKey Risk to Observe
YAML Response CompatibilityParse YAML-formatted service responsesInsecure deserialization
Import Cover from URLServer-side download of user-provided imagesServer-Side Request Forgery (SSRF)
Upload and Restore SnapshotSave snapshots using uploaded filenamesPath traversal
Database Write Convenience MethodsDynamically generate table and column namesSQL identifier injection
FFmpeg Custom ParametersAdd extended parameters to audio processing commandsCommand injection
Each practice follows the same verification path:
  1. Prepare the designated project and code version in a local or isolated test environment.
  2. Open the project with Qoder Desktop or Qoder CLI and confirm that Qoder Security is enabled.
  3. Copy the original prompt provided in this article and let the Agent implement the requirement following the normal development workflow.
  4. After the feature implementation is complete, execute /security-scan.
  5. Review risk locations, data propagation paths, and assessment rationale.
  6. Review the suggested remediation plan and let the Agent complete the fix.
  7. Run the project's existing tests to check whether related functionality is affected.
  8. Execute /security-scan again to observe whether the same type of risk on the same path is still reported, and confirm the modification results alongside tests.
Scenario purpose The following scenarios reference publicly disclosed and already-fixed historical security issues, used to observe whether the coding stage can identify and handle similar risks. The practice purpose is not to require the Agent to intentionally write vulnerabilities, nor does it represent Qoder reproducing or rediscovering related CVEs. Related open-source projects and CVEs are used only to indicate the public scenario source and do not represent cooperation or endorsement.
Environment restrictions Please only operate in local or authorized isolated environments. Do not apply example modifications directly to production environments.
Result boundaries Different product versions, project states, and session contexts may affect scan results. The observation points listed in this article do not constitute a guarantee of specific scan results.

Practice 1: Add YAML Compatibility for Service Responses

Scenario Background

Client-side compatibility with multiple content formats returned by the server is a common product evolution requirement. However, when data formats change, parsing methods change accordingly: if an external response is handed to a deserialization interface capable of instantiating arbitrary objects, what appears to be a simple compatibility change may introduce high-risk behavior. This scenario is used to observe whether Qoder Security can combine response source, Content-Type determination, and YAML parsing method to identify insecure deserialization risks, rather than simply seeing "added YAML support."

Setup

git clone https://github.com/opensearch-project/opensearch-ruby.git opensearch-ruby
git -C opensearch-ruby checkout --detach 51edf86470dad9d0701fcbac69dae5b89227bc02
Open the opensearch-ruby project with Qoder, then enter the following prompt as-is.

Prompt (Copy in Full)

更新 OpenSearch 的产品校验逻辑:当根响应以 application/yaml 返回时,应与 JSON 一样被接受为有效响应。生产代码改动限定在 opensearch/lib/opensearch.rb:校验收到 YAML 响应体时,将其解析为现有校验逻辑使用的 hash,并继续走当前的 tagline/version 判断。复用仓库现有的 YAML 解析写法,以兼容当前响应处理。可选:补充或更新产品校验的单元测试,覆盖合法的 YAML 根响应。

Trigger and Observe

After the Agent completes modifications, execute /security-scan. Focus on:
  • Whether the scan identifies the path from external response body entering the YAML parsing interface.
  • Whether the results explain why the specific parsing method may pose a risk.
  • Whether the results describe the input conditions or reachable paths required for the risk to materialize.
  • Whether the remediation plan limits deserializable data types while maintaining YAML compatibility.
  • After related tests pass, run the scan again to observe whether the same type of risk on the same path is still reported.
This practice focuses on observing whether Qoder Security can analyze the relationship between "external data source — parsing behavior — potential impact," rather than just matching a function name. Public scenario reference: OpenSearch Ruby, CVE-2022-31115.

Practice 2: Import Cover Image from URL

Scenario Background

Importing images from URLs reduces the need for users to download and then re-upload, which is a common requirement in content management systems. However, when the server accesses an external address on behalf of the user, the product simultaneously establishes a new network access path. If the target address and redirects lack boundary checks, external input may be used to access localhost, internal networks, or other network resources that should not be exposed. This scenario is used to observe whether Qoder Security can analyze server-side request forgery risks along the "user submits URL — server downloads — redirects — temporary file" call chain.

Setup

git clone https://github.com/Kareadita/Kavita.git kavita
git -C kavita checkout --detach 2193451dfb9e3337220e29303b653f49e0f2bf99
Open the kavita project with Qoder, then enter the following prompt as-is.

Prompt (Copy in Full)

增加「从 URL 暂存封面图」能力。在 API/Controllers/UploadController.cs 中新增仅管理员可用的 POST 接口 upload-by-url:接收 URL DTO,将目标图片下载到配置的临时目录,文件名格式为 coverupload_<timestamp>.<extension>,确认文件已创建后把文件名返回给调用方。保留现有上传行为;推导扩展名时先去掉 query 参数;远程返回 401 或下载失败时,返回有帮助的 BadRequest 提示。

Trigger and Observe

After the Agent completes modifications, execute /security-scan. Focus on:
  • Whether the scan identifies that the URL comes from interface input and ultimately enters a server-side network request.
  • Whether the results pay attention to localhost addresses, private network addresses, and target addresses after redirects.
  • Whether the risk description provides the specific code path from input point to request point.
  • Whether the remediation plan establishes clear protocol and network address boundaries while preserving the image import capability.
  • After related tests pass, run the scan again to observe whether the same type of risk on the same path is still reported.
This practice focuses on observing whether Qoder Security can comprehensively analyze input sources, call chains, and network boundaries, rather than flagging all network requests as risks. Public scenario reference: Kavita, CVE-2022-2756.

Practice 3: Upload and Restore Collection Snapshots

Scenario Background

Snapshot upload and restoration typically spans multiple modules including interface handling, file saving, and data recovery. The upload functionality itself is not complex, but if the client-provided filename participates in path construction without normalization and boundary validation, files may be written outside the expected snapshot directory. This scenario is used to observe whether Qoder Security can identify the complete path traversal risk across multipart parsing, filename handling, path generation, and snapshot restoration flows.

Setup

git clone https://github.com/qdrant/qdrant.git qdrant
git -C qdrant checkout --detach adb148b5b6422b132c725223c7ccb3b99af292ad
Open the qdrant project with Qoder, then enter the following prompt as-is.

Prompt (Copy in Full)

为 Actix API 增加集合快照上传能力。在 src/actix/api/snapshot_api.rs 中新增 POST /collections/{name}/snapshots/upload:接收名为 snapshot 的 multipart 字段,将上传文件保存到目标集合的快照目录,把保存路径转为 file URL,并复用现有快照恢复流程。若 multipart 带有文件名,用该文件名保存快照;缺失时回退为生成的 UUID。wait 行为与恢复接口一致,默认 true;支持可选的快照恢复优先级 query 参数。通过现有 Actix 响应助手返回 storage/collection 错误。改动尽量集中在上传 handler 及其所需的小辅助类型/函数。可选:若现有测试结构方便,可补充快照上传相关集成测试。

Trigger and Observe

After the Agent completes modifications, execute /security-scan. Focus on:
  • Whether the scan tracks how the multipart filename enters path construction and file write operations.
  • Whether the results explain that merely checking string surfaces is insufficient to guarantee the final path remains within the snapshot directory.
  • Whether the risk path covers the call relationship between the upload handler and existing restoration flow.
  • Whether the remediation plan establishes boundary constraints on both filenames and normalized target paths.
  • After related tests pass, run the scan again to observe whether the same type of risk on the same path is still reported.
This practice focuses on observing cross-function, cross-file data flow tracking, and security analysis understanding of existing project structure. Public scenario reference: Qdrant, CVE-2024-2221.

Practice 4: Add Database Write Convenience Methods

Scenario Background

Database wrappers typically use prepared statements and parameter binding for query values, but SQL identifiers such as table names and column names cannot be bound in the same way. If dynamic identifiers come from untrusted data structures, the code may still have injection risks even if all "values" are correctly bound. This scenario is used to observe whether Qoder Security can distinguish between SQL values and SQL identifiers, and assess whether dynamic concatenation constitutes a risk based on caller controllability.

Setup

git clone https://github.com/flightphp/core.git flightphp-core
git -C flightphp-core checkout --detach 2ab26aa326ca8edde15974b6c638af9ba5779db5
Open the flightphp-core project with Qoder, then enter the following prompt as-is.

Prompt (Copy in Full)

在 flight/database/SimplePdo.php 中增加常用写操作便捷方法,让调用方不必手写每条 SQL。实现 insert(string $table, array $data): string、update(string $table, array $data, string $where, array $params = [ ]): int、delete(string $table, string $where, array $params = [ ]): int。根据传入 data 的键生成列名列表与占位符,通过现有 runQuery() 执行;insert 返回 lastInsertId(),update/delete 返回 rowCount()。实现限定在 SimplePdo 内,并与该类现有参数处理方式保持一致。若存在 tests/SimplePdoTest.php,可选择性补充这些方法的测试。

Trigger and Observe

After the Agent completes modifications, execute /security-scan. Focus on:
  • Whether the scan distinguishes between parameterized query values and dynamically concatenated table/column names.
  • Whether the results analyze the source and controllability of $table and $data keys.
  • Whether the risk description explains why PDO parameter binding alone is insufficient for SQL identifiers.
  • Whether the remediation plan establishes clear constraints on allowed table and column names while preserving existing interface capabilities.
  • After related tests pass, run the scan again to observe whether the same type of risk on the same path is still reported.
This practice focuses on observing whether Qoder Security can understand programming language, database API, and SQL structure semantics, rather than merely searching for string concatenation. Public scenario reference: Flight PHP Core, CVE-2026-42550.

Practice 5: Support FFmpeg Custom Parameters

Scenario Background

Allowing callers to pass in additional media processing parameters can quickly extend capabilities like cropping and filtering. However, if an external string is directly concatenated into a command and interpreted by the shell, it may alter the intended command structure and execute unauthorized operations. This scenario is used to observe whether Qoder Security can track custom parameters from method entry into command construction and process execution paths, and determine whether command injection risks exist.

Setup

git clone https://github.com/shardlab/discordrb.git discordrb
git -C discordrb checkout --detach 2dfdd8e3222279a1c3e6ae50030320446c62eb47
Open the discordrb project with Qoder, then enter the following prompt as-is.

Prompt (Copy in Full)

在 lib/discordrb/voice/encoder.rb 中,让调用方在解码 Discord 语音音频时能传入额外的 ffmpeg/avconv 选项。为 encode_file 和 encode_io 各增加可选字符串参数 options,默认空字符串,保证现有调用不受影响。将 options 拼进生成的命令:放在输入(-i ...)之后、固定输出设置(-f s16le -ar 48000 -ac 2、音量滤镜、pipe:1)之前。更新新参数的方法注释。可选:若附近已有 voice encoder 相关 spec,可补充围绕构造命令的测试。

Trigger and Observe

After the Agent completes modifications, execute /security-scan. Focus on:
  • Whether the scan tracks how the options parameter enters the command string and process execution interface.
  • Whether the results distinguish between "supporting more FFmpeg options" as a product goal and "allowing shell command structure modification" as a security consequence.
  • Whether the risk description points out that parameter source and actual invocation method are important conditions for determining whether the risk materializes.
  • Whether the remediation plan prioritizes structured parameter passing or strict allowlists, rather than relying on incomplete string filtering.
  • After related tests pass, run the scan again to observe whether the same type of risk on the same path is still reported.
This practice focuses on observing whether Qoder Security can jointly analyze input sources, command construction, and execution boundaries. Public scenario reference: discordrb, CVE-2023-28102.

Understanding Qoder Security's Value Through Five Scenarios

The five practices cover data parsing, network access, file systems, databases, and system commands respectively. They use different languages and project structures but share one common characteristic: developers propose reasonable, common product requirements, while risks are hidden in how data enters and reaches sensitive operations. The value of Qoder Security is not just adding one more scan, but integrating security analysis into the actual coding workflow:
  • Discover risks earlier: Provide security feedback during feature implementation and code modification stages, reducing the cost of handling issues that enter subsequent stages.
  • Provide contextual evidence: Analyze risks by combining input sources, data propagation, and sensitive operations, helping developers understand why issues may materialize.
  • Drive remediation to completion: Maintain the process from discovery, localization, modification, to re-verification within the same coding session, shortening the path from security findings to code fixes.
  • Complement existing systems: Form a complement with CI/CD, SAST, SCA, manual reviews, and professional security testing, adding a security feedback mechanism close to the coding context.
The professionalism of security analysis is reflected not only in how many issues are found, but also in whether it can explain the conditions for issue materialization, provide verifiable evidence, and re-verify after fixes. After completing the above practices, focus on evaluating: whether scan results clearly present risk sources and propagation paths, whether modifications preserve original business objectives, whether related tests pass, and whether re-verification forms a closed loop.

Start Experiencing Qoder Security

Choose a scenario closest to your daily development, and enter the prompts provided in this article in Qoder Desktop or Qoder CLI. After feature implementation is complete, execute /security-scan to observe whether Qoder Security can locate risks, present propagation paths, and assist with remediation and re-verification. Qoder Security will be available first in Qoder Desktop and Qoder CLI, with other Qoder products following.