dify-knowledge-base-upload
Warn
Audited by Gen Agent Trust Hub on Mar 16, 2026
Risk Level: MEDIUMCOMMAND_EXECUTIONDATA_EXFILTRATIONCREDENTIALS_UNSAFEPROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The script
scripts/upload_to_dataset.pyexecutes the systemcurlbinary using thesubprocess.runmethod to perform network requests. - Evidence: Functions
run_curl_json,upload_document,list_metadata_fields, andwrite_document_metadataall construct and executecurlcommands with various parameters. - [DATA_EXFILTRATION]: The skill provides an interface to read any accessible local file and transmit its contents to a user-defined network endpoint.
- Evidence: The
--fileargument inscripts/upload_to_dataset.pyaccepts any path, and theDIFY_API_BASE_URLcan be configured to any domain. If an agent is tricked into selecting sensitive files (e.g.,~/.ssh/id_rsa,.env) and a malicious URL, the skill acts as an exfiltration bridge. - [CREDENTIALS_UNSAFE]: The skill processes a sensitive Dify API key and sends it over the network in the
Authorizationheader. - Evidence: The
DIFY_API_KEYis retrieved from environment variables or CLI arguments and is passed tocurlas a plaintext header, making it vulnerable to interception if the destination URL is not trusted. - [PROMPT_INJECTION]: The skill is vulnerable to indirect prompt injection due to its processing of untrusted local data combined with network write capabilities.
- Ingestion points: Local file contents and JSON metadata are loaded and processed in
scripts/upload_to_dataset.pythrough the--fileand--metadata-jsonarguments. - Boundary markers: No delimiters or "ignore embedded instructions" warnings are implemented in the prompt logic or script handling.
- Capability inventory: The script has the capability to read from the filesystem and write to network endpoints via
subprocesscalls tocurl. - Sanitization: There is no evidence of data sanitization or validation of the content being uploaded to the Dify API.
Audit Metadata