T09 · Insecure Skill Coding Practices
- Location
scripts/setup_notebooklm_mcp.sh:78- Finding
Platform Filter Modifies an Unselected Devin Agent Configuration
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup_notebooklm_mcp.sh, lines 67 and 74–129, with the flawed selection condition at lines 78–79
Vulnerability Type: Persistent configuration modification outside the user-selected platform
Risk Level: MediumVulnerable Code
bash declare -a PLATFORMS=( "Claude Code|$HOME/.claude.json|mcpServers.notebooklm-mcp|standard" "Claude Desktop|$HOME/Library/Application Support/Claude/claude_desktop_config.json|mcpServers.notebooklm-mcp|standard" "Cursor|$HOME/.cursor/mcp.json|mcpServers.notebooklm-mcp|standard" "Devin CLI|$HOME/.config/devin/mcp_config.json|mcpServers.notebooklm-mcp|standard" "Devin CLI (legacy)|$HOME/.config/devin/config.json|mcpServers.notebooklm-mcp|standard" "Devin Desktop|$HOME/.devin/mcp_config.json|mcpServers.notebooklm-mcp|standard" "OpenCode|$HOME/.config/opencode/opencode.json|mcp.notebooklm-mcp|opencode" "OpenCode (project)|$HOME/opencode.json|mcp.notebooklm-mcp|opencode" "Antigravity IDE/CLI|$HOME/.gemini/config/mcp_config.json|mcpServers.notebooklm-mcp|standard" ) patch_json() { local label="$1" path="$2" jsonpath="$3" format="$4" [ -f "$path" ] || return 0 if [ -n "$TARGET_PLATFORM" ] && [ "$label" != "$TARGET_PLATFORM" ] && [ "$label" != "Devin CLI (legacy)" ]; then return 0 fi # ... CMD="$CMD" ARGS_JSON="$ARGS_JSON" ARGS_OPCODE="$ARGS_OPCODE" \ python3 - "$path" "$jsonpath" "$format" "$REMOVE" <<'PY' # ... if remove: parent.pop(last, None) else: if fmt == "opencode": parent[last] = { "type": "local", "command": args_opc, "enabled": True } else: parent[last] = { "command": cmd, "args": args_list } with open(path, 'w') as f: j.dump(d, f, indent=2) PY }The documented targeted invocation is:
bash bash setup_notebooklm_mcp.sh --platform cursorArgument parsing stores that value without normalization:
bas ...[truncated 2691 chars]- Remediation
View remediation
Remediation Suggestions
- Replace human-readable labels with canonical platform identifiers such as
cursor,devin-cli, andopencode. - Normalize and validate
--platformbefore any configuration is opened or modified. - Permit the legacy Devin path only when the canonical selected platform is Devin CLI.
- Reject unknown platform names rather than silently completing without modifying the requested target.
- Separate display labels from matching identifiers.
For example:
bash normalize_platform() { case "${1,,}" in cursor) echo "cursor" ;; claude-code) echo "claude-code" ;; claude-desktop) echo "claude-desktop" ;; devin-cli|devin) echo "devin-cli" ;; devin-desktop) echo "devin-desktop" ;; opencode) echo "opencode" ;; antigravity) echo "antigravity" ;; openclaw) echo "openclaw" ;; *) return 1 ;; esac } if [ -n "$TARGET_PLATFORM" ]; then TARGET_PLATFORM="$(normalize_platform "$TARGET_PLATFORM")" || { echo "Unsupported platform: $TARGET_PLATFORM" >&2 exit 64 } fiPlatform definitions should include a canonical identifier:
bash "devin-cli|Devin CLI|$HOME/.config/devin/mcp_config.json|mcpServers.notebooklm-mcp|standard" "devin-cli|Devin CLI (legacy)|$HOME/.config/devin/config.json|mcpServers.notebooklm-mcp|standard"Then enforce exact identifier matching:
bash if [ -n "$TARGET_PLATFORM" ] && [ "$platform_id" != "$TARGET_PLATFORM" ]; then return 0 fiAdd automated tests confirming that each supported
--platformvalue modifies only the intended current and legacy paths, and that unknown or differently cased input cannot result in modification of an unrelated client configuration.- Replace human-readable labels with canonical platform identifiers such as
