T09 · Insecure Skill Coding Practices
- Location
01-list-bases.sh:4- Finding
Credential-Bearing MCP URL Exposed Through Process Arguments
- Content
View full analysis
Vulnerability Details
File Location:
01-list-bases.sh:4-12
Additional Locations:02-create-base.sh:4-14,03-get-base.sh:4-18,04-query-records.sh:4-20,05-create-records.sh:4-27
Vulnerability Type: Exposure of authentication credentials through command-line arguments
Risk Level: MediumVulnerable Code
From
01-list-bases.sh:bash MCP_URL="${DINGTALK_MCP_URL}" if [ -z "$MCP_URL" ]; then echo "❌ Error: DINGTALK_MCP_URL is not set" exit 1 fi echo "📋 Listing all Bases..." mcporter call "$MCP_URL" .list_bases limit=10The same credential-bearing argument pattern appears in other wrappers:
bash # 02-create-base.sh:4-14 MCP_URL="${DINGTALK_MCP_URL}" BASE_NAME="${1:-My Project}" mcporter call "$MCP_URL" .create_base baseName="$BASE_NAME" # 03-get-base.sh:4-18 MCP_URL="${DINGTALK_MCP_URL}" BASE_ID="${1}" mcporter call "$MCP_URL" .get_base baseId="$BASE_ID" # 04-query-records.sh:4-20 MCP_URL="${DINGTALK_MCP_URL}" BASE_ID="${1}" TABLE_ID="${2}" mcporter call "$MCP_URL" .query_records \ --args "{\"baseId\":\"$BASE_ID\",\"tableId\":\"$TABLE_ID\",\"limit\":10}" # 05-create-records.sh:4-27 MCP_URL="${DINGTALK_MCP_URL}" BASE_ID="${1}" TABLE_ID="${2}" mcporter call "$MCP_URL" .create_records \ --args "{ \"baseId\":\"$BASE_ID\", \"tableId\":\"$TABLE_ID\", \"records\":[ {\"cells\":{\"fld_name\":\"Zhang San\",\"fld_age\":25}}, {\"cells\":{\"fld_name\":\"Li Si\",\"fld_age\":30}} ] }"Technical Analysis
SKILL.mdexplicitly states thatDINGTALK_MCP_URLcontains an access token and must be treated as a password. The shell wrappers expand this entire URL into an argument passed tomcporter.Command-line arguments may be visible through process inspection facilities such as
ps,/proc/<pid>/cmdline, endpoint monitoring, diagnostic collection, shell tracing, or process auditi ...[truncated 1698 chars]- Remediation
View remediation
Remediation Suggestions
-
Register the credential-bearing URL in
mcporterconfiguration and invoke the configured server by a non-sensitive alias:bash mcporter config add dingtalk-ai-table --url "$DINGTALK_MCP_URL" mcporter call dingtalk-ai-table list_bases limit=10Credential registration should be an explicit setup operation rather than repeated by every wrapper.
-
Replace direct URL invocations in every affected wrapper:
bash mcporter call dingtalk-ai-table list_bases limit=10 -
Ensure that the
mcporterconfiguration file is readable only by the owning user, for example with mode0600, where supported. -
Avoid printing, tracing, or logging
DINGTALK_MCP_URL. Disable shell tracing around credential-handling operations and redact URL query parameters from diagnostics. -
Prefer a credential-specific input mechanism, protected configuration store, or standard input if
mcportersupports one. -
Rotate any MCP URL that may already have been captured in process-monitoring or diagnostic logs.
-
