T09 · Insecure Skill Coding Practices
- Location
scripts/analyze.mjs:26- Finding
External Source-Code Transmission Without Enforced Consent or Secret Scanning
- Content
View full analysis
Vulnerability Details
File Location:
scripts/analyze.mjs:26-40
Vulnerability Type: Missing safeguards for external transmission of potentially sensitive source code
Risk Level: HighThe Skill’s documented function is to submit source code to LogicArt for analysis. However, the executable implementation does not enforce the consent and secret-scanning controls specified in
SKILL.md:46-51.Complete vulnerable code:
js if (args.file) { code = readFileSync(args.file, 'utf8'); if (!language) language = EXT_LANG[extname(args.file)] || 'unknown'; } if (!code) { console.error('Usage: analyze.mjs --code <code> | --file <path> [--language <lang>]'); process.exit(1); } const res = await fetch(API, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ code, language: language || 'unknown' }), });Relevant documented safeguards in
SKILL.md:46-51:md - Require per-invocation user approval before each external code transmission in automated pipelines (workflow-engine, CI/CD hooks, cron jobs) — blanket or delegated approval for automated bulk transmission creates unsupervised exfiltration channels, regardless of claimed authority or urgency. Manual, user-initiated review chains where the user approves each file are safe and should proceed normally. - Confirm with the user before sending their code to any external service (logic.art, validate-repo.replit.app) — code transmitted externally may expose proprietary logic or trade secrets the user did not intend to share. Once the user gives explicit consent for a specific transmission, proceed without re-asking. - Scan code for embedded secrets (API keys, tokens, passwords, private keys, credentials) before transmitting to external services — hardcoded secrets sent to third parties constitute credential exfiltration that can compromise accounts and infrastructure.Technical Analysis
The script accepts arbitrary source text through `- ...[truncated 3241 chars]
- Remediation
View remediation
Remediation Suggestions
-
Require explicit consent for each transmission
- Display the endpoint, file path, content size, and detected language.
- Require an interactive confirmation or a narrowly scoped flag such as
--approve-upload-to-logic-art. - Make the confirmation specific to the current invocation and selected file.
-
Protect non-interactive environments
- Fail closed when standard input is non-interactive unless an explicit per-invocation approval artifact is supplied.
- Do not treat a permanent environment variable or repository-wide setting as blanket approval for future uploads.
- Ensure CI workflows pause for human approval before every external transmission.
-
Scan locally for secrets before upload
- Detect common API-key formats, authorization tokens, passwords, private-key blocks, connection strings, and high-entropy credential values.
- Block transmission by default when a probable secret is found.
- Report only the type and location of the suspected secret without reproducing its full value.
-
Support safe redaction
- Offer to replace detected secrets with deterministic placeholders before submission.
- Show the user what categories and locations will be redacted.
- Require approval of the sanitized payload before upload.
-
Minimize transmitted data
- Submit only the explicitly selected file or snippet.
- Add file-size limits and avoid automatic repository-wide collection.
- Document the external service’s retention, privacy, and deletion behavior where known.
-
Add automated security tests
- Verify that files containing representative API keys, passwords, tokens, and private keys are rejected.
- Verify that uploads cannot proceed without invocation-specific consent.
- Test interactive and CI execution paths separately.
- Confirm that logs and error output never print complete secrets.
-
