T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/flomo-add.py:56
- Finding
- Unrestricted Outbound Webhook Destination## Vulnerability Details **File Location**: `scripts/flomo-add.py`, lines 56-72 **Vulnerability Type**: Unvalidated outbound request destination **Risk Level**: Medium **Relevant Code**: ```python url = (args.url or config.get("url", "")).strip() ``` ```python response = requests.post(url, json=payload, headers=headers, timeout=15) ``` ### Technical Analysis The script accepts a destination from either the `--url` argument or the `url` configuration entry and passes it directly to `requests.post`. It only verifies that the value is nonempty. It does not require HTTPS, restrict the hostname to an authorized flomo domain, reject local or private-network addresses, or constrain redirects. Consequently, anyone able to influence the command arguments or `.flomo.config` can direct memo content to an arbitrary server. Because the `requests` library follows redirects by default, an initially acceptable URL could also redirect the request to another destination unless redirects are disabled or each redirect target is validated. ### Attack Path 1. An attacker modifies `.flomo.config`, supplies a prepared invocation, or persuades the user to use `--url` with an attacker-controlled address. 2. The user invokes the Skill with sensitive memo content. 3. The script accepts the address because it is nonempty. 4. The script sends the memo in a JSON POST request to the attacker-controlled server. 5. Alternatively, the supplied destination can reference a reachable internal service, resulting in a limited server-side request forgery primitive. ### Impact Assessment An attacker can receive the complete memo content submitted during the affected invocation. A plaintext HTTP destination can also expose that content to network interception. The script may issue POST requests to internal, loopback, private, or link-local endpoints accessible from the host. This does not directly grant command execution or elevated privileges, but i ...[truncated 220 chars]
- Remediation
- ## Remediation Suggestions - Parse the destination with a standard URL parser and reject malformed URLs. - Require the `https` scheme. - Restrict the hostname to the exact authorized flomo webhook hostname or a narrowly defined allowlist. - Reject embedded credentials, unexpected ports, fragments, and ambiguous hostname encodings. - Resolve the hostname and reject loopback, private, link-local, multicast, reserved, and unspecified IP addresses where appropriate. - Disable redirects with `allow_redirects=False`, or validate the scheme, hostname, port, and resolved address of every redirect target before following it. - Consider removing `--url` if runtime destination overrides are unnecessary. - Add tests covering HTTP URLs, attacker-controlled hosts, loopback addresses, private addresses, IPv6 variants, and redirect-based bypasses.
