T09 ยท Insecure Skill Coding Practices
Warning
- Location
- examples/post-job.js:17
- Finding
- Example command creates a public promotional job without explicit confirmation<![CDATA[ ## Vulnerability Details **File Location**: `examples/post-job.js:17-42` **Vulnerability Type**: Unintended authenticated external side effect **Risk Level**: Medium The README quick-start instructions at `README.md:17-26` tell users to execute the example directly: ```bash export MEATMARKET_API_KEY=mm_... node examples/post-job.js ``` The invoked script does not preview the operation and request confirmation. Instead, it immediately creates a hard-coded paid promotional job: ```javascript async function postJob() { // Customize this job object for your needs const job = { title: "Social media post about AI tools", description: `Post about MeatMarket on X (Twitter). Requirements: - Mention @meatmarket_fun - Include a brief description of what MeatMarket does (AI hiring humans) - Use your own words, be authentic - Submit the link to your post as proof`, skills: ["Social Media", "Writing"], pay_amount: 5.00, blockchain: "Base", time_limit_hours: 48 }; console.log('Posting job to MeatMarket...'); console.log(JSON.stringify(job, null, 2)); try { const res = await fetch(`${BASE_URL}/jobs`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'x-api-key': API_KEY }, body: JSON.stringify(job) }); ``` ### Technical Analysis The script performs an authenticated, externally visible state-changing request as soon as it starts. Although it prints the job immediately before submission, it provides no confirmation prompt, dry-run default, or requirement that the user supply job details. This behavior is especially risky because the README presents the command as part of the quick-start process. A user may reasonably execute it to test installation or connectivity without realizing that it publishes a real job requesting promotion of MeatMarket and advertises a payment of USD 5. Transmission of `MEATMARKET_API_KEY` in the `x-api-key` header to the declared HTT ...[truncated 1622 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Make dry-run behavior the default. Print the destination, complete request body, and intended effect without sending a network request. 2. Require an explicit flag such as `--confirm-post` before issuing the authenticated `POST`. 3. Prompt for interactive confirmation immediately before submission, clearly stating that the command will create a real public job with an advertised payment. 4. Remove the hard-coded promotional task. Require users to provide the title, description, payment amount, blockchain, and time limit through validated command-line arguments or a configuration file. 5. Clearly label examples as performing real external side effects in both the README and source comments. 6. Provide a harmless connectivity-check command for quick-start use, or direct users to a non-production sandbox if one exists. 7. Validate payment amount, supported blockchain, time limit, and required fields before presenting the confirmation prompt. 8. Consider requiring a uniquely generated confirmation phrase for production requests to reduce accidental submission by automated agents. ]]>
