T09 · Insecure Skill Coding Practices
- Location
lib/checkers.py:194- Finding
Unrestricted Domain Targets Enable Server-Side Request Forgery and Internal Network Probing
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent domain-management skill, but it needs review because it can probe arbitrary network targets, use Cloudflare credentials, and delete or export sensitive portfolio data with weak warnings.
Install only if you are comfortable with a CLI that stores a local domain portfolio, performs external DNS/WHOIS/HTTP/SSL checks, and can use a Cloudflare API token. Use a least-privilege Cloudflare token, avoid scanning internal or confidential hostnames, protect exports, and be careful with remove because it deletes local records without confirmation.
lib/checkers.py:194Unrestricted Domain Targets Enable Server-Side Request Forgery and Internal Network Probing
lib/storage.py:14Portfolio Database and Log Permissions Depend on the Process Umask
README.md:240Local-Only Privacy Claim Omits Routine WHOIS, DNS, SSL, and HTTP Disclosures
The added explanatory note states that MIT-0 removes the requirement to include the license notice in distributed derivative works, which is inaccurate and creates ambiguity about downstream compliance obligations. Misstating license terms can cause users to redistribute the software under incorrect assumptions, creating legal/compliance risk and supply-chain confusion even though it is not a code-execution issue.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
This will:
1. Create a data directory at `~/.nex-domains/`
2. Initialize the SQLite database
3. Install the `nex-domains` CLI command
4. Check for required tools
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt install whois dnsutils openssl
bash setup.sh
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt install whois dnsutils openssl
bash setup.sh
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
sudo apt install whois dnsutils openssl
bash setup.sh
The README instructs users to set Cloudflare API credentials and states that sync/API operations are supported, but it does not clearly warn that these credentials are sensitive secrets or that synchronization transmits portfolio and DNS data to an external service. In this skill's context, users are managing multi-domain infrastructure, so mishandling the token could expose or modify DNS across many domains.
The README explicitly documents exporting the full domain portfolio without warning that the output may include sensitive client names, infrastructure metadata, DNS records, registrar relationships, and operational notes. In a domain-management context, those exports can materially aid reconnaissance or cause accidental data exposure if shared, backed up insecurely, or committed to source control.
The skill advertises and documents capabilities that read environment variables, perform shell execution, write local files, and access the network, but it does not declare an explicit tool scope such as permissions or allowed-tools. That mismatch can cause an agent to invoke the skill with broader authority than users expect, increasing the chance of unintended command execution, data export, or use of sensitive credentials like Cloudflare and TransIP tokens.
The trigger phrase list includes generic terms such as "domain," "DNS," "SSL," "certificate," and "Cloudflare," which are common in many benign conversations and could cause the skill to activate outside the user's intended context. Because the skill can run shell commands, use network access, and touch local state, accidental invocation could lead to unexpected scans, API calls, or disclosure of locally stored portfolio data.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run_command(cmd: List[str], timeout: int = 10) -> Optional[str]:
"""Run a shell command safely and return output."""
try:
result = subprocess.run(
cmd,
capture_output=True,
text=True,
The code constructs an HTTPS request directly from a user-controlled domain string and performs a server-side request. If an attacker can supply arbitrary hostnames, they can cause the service to probe internal or sensitive network locations, enabling SSRF-style scanning or access depending on resolver behavior and deployment environment.
# Check HTTPS
try:
req = urllib.request.Request(f'https://{domain}', method='HEAD')
with urllib.request.urlopen(req, timeout=API_TIMEOUT) as response:
result['https_status'] = response.status
except urllib.error.HTTPError as e:
This HTTP request also uses a user-controlled domain as the request target, creating the same SSRF risk over plain HTTP. In server or agent environments with network reachability to internal systems, this can be abused to map services or reach unintended endpoints.
# Check HTTP
try:
req = urllib.request.Request(f'http://{domain}', method='HEAD')
with urllib.request.urlopen(req, timeout=API_TIMEOUT) as response:
result['http_status'] = response.status
except urllib.error.HTTPError as e:
This code performs outbound network requests authenticated with a sensitive API token to enumerate Cloudflare zones, but the only nearby messaging is error logging and a missing-token warning. There is no confirmation prompt or user-facing disclosure in the code that the skill will access account data from Cloudflare using provided credentials.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
try:
req = urllib.request.Request(
'https://api.cloudflare.com/client/v4/zones?per_page=100',
headers={
'Authorization': f'Bearer {api_token}',
'Content-Type': 'application/json',
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
try:
req = urllib.request.Request(
'https://api.cloudflare.com/client/v4/zones?per_page=100',
headers={
'Authorization': f'Bearer {api_token}',
'Content-Type': 'application/json',
The function sends an authenticated HTTP request with a bearer token to retrieve DNS records, which is a safety-relevant network operation involving sensitive account context. The code lacks any confirmation prompt or user-facing notice describing that it will query external provider data using credentials.
The function deletes a domain and, per its docstring, all related data, but the only disclosure is an internal logger message emitted after deletion. There is no confirmation prompt or user-directed warning in this file before the irreversible operation occurs.
This function unconditionally deletes all existing DNS records for the domain before inserting the new set, which can cause irreversible data loss if the input is incomplete or wrong. The file contains no pre-action warning, confirmation, or explicit user disclosure beyond an internal log after completion.
The remove command deletes a stored domain immediately after a name lookup, with no confirmation prompt, dry-run mode, or safeguard against accidental invocation. In a destructive CLI that manages a local portfolio database, this creates a realistic risk of accidental data loss from user mistakes, scripting errors, or agent misuse, especially because the action appears irreversible in this code path.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo ""
echo " Install them with:"
if [ "$PLATFORM" = "linux" ]; then
echo " Ubuntu/Debian: sudo apt install ${MISSING_TOOLS[*]}"
echo " RHEL/CentOS: sudo yum install ${MISSING_TOOLS[*]}"
echo " Fedora: sudo dnf install ${MISSING_TOOLS[*]}"
elif [ "$PLATFORM" = "macos" ]; then
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo ""
echo " Install them with:"
if [ "$PLATFORM" = "linux" ]; then
echo " Ubuntu/Debian: sudo apt install ${MISSING_TOOLS[*]}"
echo " RHEL/CentOS: sudo yum install ${MISSING_TOOLS[*]}"
echo " Fedora: sudo dnf install ${MISSING_TOOLS[*]}"
elif [ "$PLATFORM" = "macos" ]; then
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo ""
echo " Install them with:"
if [ "$PLATFORM" = "linux" ]; then
echo " Ubuntu/Debian: sudo apt install ${MISSING_TOOLS[*]}"
echo " RHEL/CentOS: sudo yum install ${MISSING_TOOLS[*]}"
echo " Fedora: sudo dnf install ${MISSING_TOOLS[*]}"
elif [ "$PLATFORM" = "macos" ]; then
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
echo " All required tools found."
fi
# Step 3: Create data directory
echo "[3/5] Creating data directory..."
mkdir -p "$DATA_DIR"
if [ "$PLATFORM" != "windows" ]; then
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
echo "[3/5] Creating data directory..."
mkdir -p "$DATA_DIR"
if [ "$PLATFORM" != "windows" ]; then
chmod 700 "$DATA_DIR"
fi
echo " Data directory: $DATA_DIR"
The examples include state-changing and data-producing actions like removing a domain and exporting portfolio data, but they do not explicitly instruct the agent to warn the user that local data will be deleted or written to disk. In practice this can cause accidental loss of tracked records or creation of sensitive export files containing client, registrar, and cost information without sufficiently informed consent.
No suspicious patterns detected.