Back to skill

Security audit

KWDB Build

Security checks for vulnerabilities and agentic risk

Overview

This KaiwuDB build/test skill is coherent, but its normal workflow includes unsafe cleanup and test scripts that can delete or execute unintended local files if paths are wrong.

Review before installing. Use this only in a trusted KaiwuDB checkout, confirm the exact source directory and GOPATH, and do not let it run cleanup until the agent shows the fully resolved paths to be deleted. The skill should be hardened to use validated absolute paths, quote variables, fail on cd errors, avoid broad rm -rf globs, and avoid executing or chmodding discovered files blindly.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
references/build-questions.md:13
Finding
Destructive cleanup commands can delete files outside the intended project<![CDATA[ ## Vulnerability Details **File Location**: - `references/build-questions.md:13-26` - `references/cpp-unittest.md:25-39` - `references/golang-unittest.md:33-47` **Vulnerability Type**: Unsafe recursive deletion and insufficient path validation **Risk Level**: High The same mandatory cleanup procedure appears in all three locations: ```bash rm -rf build* rm -rf log/ rm -rf install/ rm -rf kwbase/.buildinfo rm -rf kwbase/bin rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig rm -rf qa/TEST_integration rm -rf kwbase/ui/yarn.installed rm -rf ${GOPATH}/native rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent ``` ### Technical Analysis The cleanup procedure combines `rm -rf` with relative paths, a broad `build*` wildcard, and an unquoted environment-derived path. It does not include an atomic operation that enters the expected project directory and verifies that directory before deletion. Consequently: - If the agent executes the commands from an incorrect working directory, `build*`, `log/`, and `install/` can refer to unrelated files. - The `build*` expression deletes every matching entry rather than one exact build directory. - If `GOPATH` is empty, `${GOPATH}/native` expands to `/native`. - If `GOPATH` contains whitespace or shell glob characters, the unquoted expansion can produce multiple or unintended deletion arguments. - Generated C++ files under `kwdbts2/roachpb` are deleted by wildcard without verifying that the resolved directory belongs to the validated project. Although the documentation separately requires source and GOPATH validation, the destructive command block itself does not enforce those invariants. An agent can therefore execute it from stale or incorrect shell state. ### Attack Path 1. A build or unit-test request causes the agent to apply the mandatory cleanup procedure. 2. The shell is not currently inside the validated KaiwuDB source directory, or `GOPATH` is empty or ...[truncated 822 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Resolve both the source directory and `GOPATH` to canonical absolute paths before performing cleanup. 2. Reject empty, root-level, nonexistent, or unexpected paths: ```bash : "${GOPATH:?GOPATH must be set}" project_root="$(realpath -- "$SOURCE_DIR")" gopath_root="$(realpath -- "$GOPATH")" case "$project_root" in "$gopath_root"/src/gitee.com/kwbasedb/*) ;; *) printf 'Invalid project directory\n' >&2; exit 1 ;; esac ``` 3. Enter the validated project directory and terminate if that operation fails: ```bash cd -- "$project_root" || exit 1 ``` 4. Replace `build*` with an exact allowlist such as `"$project_root/build"`. 5. Quote every path expansion, especially `"$GOPATH/native"`. 6. Before deletion, verify that each canonical target is a descendant of an approved root and is not `/`, the user's home directory, or the GOPATH root itself. 7. Prefer CMake-native cleanup where possible, such as `cmake --build "$build_dir" --target clean`. 8. Require explicit user confirmation before deleting directories outside the project root, including `"$GOPATH/native"`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_golang_test.sh:4
Finding
Failed source-directory change can execute an unintended Makefile<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run_golang_test.sh:4-9` **Vulnerability Type**: Unchecked directory change leading to unintended code execution **Risk Level**: High ```bash BASE_DIR=$1 cd $BASE_DIR/kwbase echo "=============Start to run golang unit test=============" make -f Makefile_ent test LIBPROTOBUF=${GOPATH}/native/kwdbts2/third_party/lib/libprotobuf.a PROTOBUF_INC=${GOPATH}/native/kwdbts2/third_party/include PROTOBUF_C=${GOPATH}/native/kwdbts2/third_party/bin/protoc TESTTIMEOUT=45m KWDB_LIB_DIR=${BASE_DIR}/build/lib ``` ### Technical Analysis The script neither validates its argument nor checks whether `cd` succeeds. It also does not enable fail-fast shell behavior and does not quote `BASE_DIR`. If the supplied source path is invalid, malformed, contains whitespace, or otherwise causes `cd` to fail, the script continues in the caller's current working directory. It then executes: ```bash make -f Makefile_ent test ``` A Makefile can execute arbitrary shell commands through target recipes. Therefore, if an attacker can influence the launch directory and place a malicious `Makefile_ent` there, a failed `cd` converts an apparently legitimate test invocation into execution of attacker-controlled commands. Unquoted `GOPATH` and `BASE_DIR` values also allow shell word splitting and pathname expansion, potentially corrupting Make variable assignments or redirecting the test toward unintended paths. ### Attack Path 1. An attacker creates a directory containing a malicious `Makefile_ent` with a `test` target. 2. The skill or user launches `run_golang_test.sh` while that directory is the current working directory. 3. The script receives an invalid or malformed source-directory argument. 4. `cd $BASE_DIR/kwbase` fails, but execution continues. 5. `make -f Makefile_ent test` loads the attacker's Makefile from the current directory. 6. The malicious target executes commands with the privileges and environment of the user running ...[truncated 421 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enable strict shell behavior: ```bash set -euo pipefail ``` 2. Require exactly one nonempty argument: ```bash if [[ $# -ne 1 ]]; then printf 'Usage: %s SOURCE_DIR\n' "$0" >&2 exit 2 fi ``` 3. Canonicalize and validate the source directory before use. 4. Verify expected project markers, including the appropriate Makefile, before execution. 5. Quote every expansion and explicitly terminate if `cd` fails: ```bash BASE_DIR="$(realpath -- "$1")" [[ -d "$BASE_DIR/kwbase" ]] || exit 1 cd -- "$BASE_DIR/kwbase" || exit 1 ``` 6. Quote all Make variable values: ```bash make -f Makefile_ent test \ "LIBPROTOBUF=$GOPATH/native/kwdbts2/third_party/lib/libprotobuf.a" \ "PROTOBUF_INC=$GOPATH/native/kwdbts2/third_party/include" \ "PROTOBUF_C=$GOPATH/native/kwdbts2/third_party/bin/protoc" \ "TESTTIMEOUT=45m" \ "KWDB_LIB_DIR=$BASE_DIR/build/lib" ``` 7. Implement the documented open-source versus enterprise detection rather than always invoking `Makefile_ent`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_unittest.sh:4
Finding
Failed test-directory change can execute unintended local binaries<![CDATA[ ## Vulnerability Details **File Location**: `scripts/run_unittest.sh:4-22` **Vulnerability Type**: Unchecked directory change and unsafe file iteration leading to unintended code execution **Risk Level**: High ```bash BASE_DIR=$1 cd $BASE_DIR/test echo "=============Start to run unit test=============" for case_dir in $(find $(pwd) -maxdepth 1 -type d -name "*.dir"); do case_name=$(basename ${case_dir} | grep -Po ".*(?=\.dir)") cd ${case_dir} if [ -f $case_name ];then chmod +x $case_name ./$case_name else echo "Test executable not found: $case_name" fi cd .. done ``` ### Technical Analysis The script does not validate the source-directory argument and does not terminate when `cd $BASE_DIR/test` fails. If that directory change fails, the script searches the caller's current directory for directories named `*.dir`. For every matching directory, it derives an executable name from the directory name, adds executable permission with `chmod +x`, and runs the resulting file. An attacker who controls the current working directory can therefore prepare a matching structure such as: ```text payload.dir/ └── payload ``` If the initial `cd` fails, the script can execute `payload.dir/payload`. The implementation also uses command substitution and unquoted expansions: ```bash for case_dir in $(find $(pwd) ...) ``` This causes shell word splitting and pathname expansion. Directory names containing spaces, newlines, or wildcard characters can be interpreted incorrectly and can alter control flow or select unintended files. ### Attack Path 1. An attacker creates `payload.dir/payload` in a directory they control. 2. The `payload` file contains attacker-selected executable code but does not need to have executable permission initially. 3. The skill or user launches `run_unittest.sh` from that directory with an invalid source path. 4. The initial `cd` fails and the script remains in the attacker-controlled direct ...[truncated 672 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add `set -euo pipefail` at the beginning of the script. 2. Require exactly one source-directory argument and canonicalize it with `realpath`. 3. Verify that the canonical test directory is a descendant of the expected source root. 4. Terminate immediately if entering the test directory fails: ```bash test_dir="$(realpath -- "$BASE_DIR/test")" [[ -d "$test_dir" ]] || exit 1 cd -- "$test_dir" || exit 1 ``` 5. Replace command substitution with null-delimited iteration: ```bash while IFS= read -r -d '' case_dir; do case_name="${case_dir##*/}" case_name="${case_name%.dir}" executable="$case_dir/$case_name" if [[ -f "$executable" && -x "$executable" ]]; then "$executable" else printf 'Invalid test executable: %s\n' "$executable" >&2 fi done < <(find "$test_dir" -mindepth 1 -maxdepth 1 -type d -name '*.dir' -print0) ``` 6. Do not automatically grant executable permission. Test executables should already have the expected mode as a result of the trusted build process. 7. Validate each executable against the build manifest or require it to reside beneath the canonical build/test output directory before execution. ]]>
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (43)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding
The skill claims strict confirmation requirements, CMake option restrictions, and support for multiple build/test flows, but the file mostly contains descriptive references rather than enforceable controls. When safety-critical behavior is declared but not operationally constrained, an agent may act outside the promised workflow, skip confirmations, or execute undocumented build/test actions.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
Confidence
98% confidence
Finding
`rm -rf build*` is a broad destructive glob that can delete more than the intended build directory, including similarly named files or directories in the current working directory. Because the skill mandates this as part of its normal workflow, an agent could execute it in the wrong directory or with unexpected matches, causing significant data loss.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
Confidence
97% confidence
Finding
`rm -rf log/` permanently deletes a directory using a relative path, making the effect dependent on the current working directory. In an agent-driven build flow, any directory confusion could result in unintended deletion of unrelated logs or data.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
Confidence
97% confidence
Finding
`rm -rf install/` removes an installation directory recursively with no scope guard, backup, or warning. If the current directory is not what the skill expects, this can delete unrelated installed artifacts or user data.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
Confidence
95% confidence
Finding
`rm -rf kwbase/.buildinfo` targets a specific build artifact and is less risky than broader patterns, but it is still an irreversible deletion command with no path validation. If executed from an unexpected directory tree, it could still affect the wrong repository checkout.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
Confidence
97% confidence
Finding
`rm -rf kwbase/bin` recursively removes a binary directory that may contain built artifacts a user wishes to preserve. In an automated skill, doing so without an explicit warning or precise workspace validation can lead to avoidable data loss.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
Confidence
95% confidence
Finding
Removing `qa/TEST_integration` is a narrower cleanup action, but it still performs irreversible deletion based on a relative path assumption. The absence of path checks or user acknowledgment makes it unsafe in an agent execution context.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent
Confidence
95% confidence
Finding
Deleting `kwbase/ui/yarn.installed` is likely intended to reset frontend build state, but it remains an unchecked destructive filesystem operation. In the wrong directory context, even specific relative paths can remove unintended files.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent
```
Confidence
99% confidence
Finding
`rm -rf ${GOPATH}/native` is particularly dangerous because it deletes a path derived from an environment variable that may be unset, malformed, or broader than intended. If `GOPATH` is incorrect or manipulated, the command could erase unrelated directories outside the repository workspace.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent
```
Confidence
97% confidence
Finding
`rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h` uses wildcards to delete multiple source-like files, creating risk if the matched files are not purely generated artifacts. In an automated build skill, wildcard deletions without generation checks can remove tracked or manually modified files.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
Confidence
93% confidence
Finding
`rm -rf log/` deletes a generic relative directory name that may not be scoped to the intended project root if the current directory is wrong. This creates avoidable risk of destroying unrelated logs or artifacts in the operator's environment.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
Confidence
93% confidence
Finding
`rm -rf install/` removes a generic relative directory and depends on the current working directory being correct. In an automated agent setting, that assumption is fragile and can lead to deletion of unrelated installation artifacts.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
Confidence
88% confidence
Finding
`rm -rf kwbase/.buildinfo` targets a specific file in the repository and is less risky than the broader glob-based deletions, but it is still a destructive operation without path validation. If executed from an unexpected location or against the wrong checkout, it can remove state the user did not intend to destroy.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
Confidence
91% confidence
Finding
`rm -rf kwbase/bin` recursively deletes a directory that may contain built binaries or other artifacts important to the user. Without path validation and explicit warning, an agent can remove more than the user expects during a test workflow.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
Confidence
85% confidence
Finding
Deleting `kwbase/build/defs.mk` and `kwbase/build/defs.mk.sig` is narrowly targeted, but still constitutes unvalidated destructive behavior. In an agent context, even small destructive steps should be constrained to a known workspace and disclosed to the user.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
Confidence
90% confidence
Finding
`rm -rf qa/TEST_integration` recursively removes a project subdirectory based on a relative path assumption. If the agent's working directory is not exactly the intended repository root, it may delete unrelated content with the same path.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent
Confidence
87% confidence
Finding
`rm -rf kwbase/ui/yarn.installed` appears intended to remove a generated marker file, but it remains a destructive action without path or trust validation. The risk is lower than broad globs, yet still inappropriate to run blindly in an agent instruction set.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent
```
Confidence
99% confidence
Finding
`rm -rf ${GOPATH}/native` is especially dangerous because it deletes outside the repository using an environment variable that may point to a shared developer workspace. This can destroy unrelated dependencies or user data and is more severe in an agent setting where environment state may be opaque.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
cd kwbase && GOPATH=${GOPATH} make clean -f Makefile_ent
```
Confidence
92% confidence
Finding
`rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h` uses globs to delete generated source/header files, which can remove unintended files if the path contains hand-edited or unexpected content. In an automated agent flow, wildcard deletions are risky because they are hard to audit and easy to mis-scope.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
Confidence
97% confidence
Finding
The mandated clean step includes 'rm -rf build*', a broad recursive deletion pattern that can remove more than the intended build directory depending on the current working directory and matching paths. Because the skill instructs this as a required pre-step, accidental or malformed execution could destroy unrelated local data.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
```bash
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
Confidence
95% confidence
Finding
The skill instructs unconditional recursive deletion of 'log/' without showing that the path is anchored to a validated repository root. If executed from an unexpected directory, this could delete unrelated logs and operational artifacts outside the intended project scope.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf build*
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
Confidence
94% confidence
Finding
The command removes 'install/' recursively as a mandatory cleanup action, but the instruction does not bind it to a verified project root at execution time. In a mis-scoped shell context, this can wipe unrelated installation artifacts or packaging outputs.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf log/
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
Confidence
89% confidence
Finding
Removing 'kwbase/.buildinfo' is narrower than the other cleanup commands, but it is still a destructive file deletion performed without explicit path canonicalization safeguards. The risk is lower because the target is a specific build artifact path, yet it remains unsafe if execution context or repository path assumptions are wrong.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf install/
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
Confidence
93% confidence
Finding
The command recursively deletes 'kwbase/bin', which may contain built binaries or tooling, and the instruction makes this mandatory without scoped execution safeguards. If the repository root or working directory is misidentified, important binaries in an unintended location could be removed.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
rm -rf kwbase/.buildinfo
rm -rf kwbase/bin
rm -rf kwbase/build/defs.mk kwbase/build/defs.mk.sig
rm -rf qa/TEST_integration
rm -rf kwbase/ui/yarn.installed
rm -rf ${GOPATH}/native
rm -rf kwdbts2/roachpb/*.cc kwdbts2/roachpb/*.h
Confidence
91% confidence
Finding
Deleting 'kwbase/build/defs.mk' and its signature file is aimed at resetting generated build metadata, but it still uses destructive file removal without path-safety checks. The scope is relatively narrow, so impact is lower than wildcard or top-level directory removal, though misexecution could still affect unintended files if path assumptions fail.

Static analysis

No suspicious patterns detected.