T09 · Insecure Skill Coding Practices
- Location
src/index.ts:10- Finding
Configured AIN Configuration Path Is Ignored
- Content
View full analysis
Vulnerability Details
File Location:
src/index.ts:10-12
Vulnerability Type: Configuration security-boundary bypass
Risk Level: MediumVulnerable Code
ts async register(api: OpenClawPluginApi) { const pluginConfig = api.pluginConfig as AinPluginConfig; const config = loadConfig(); registerAinProviders(api, config);The plugin declares and documents a
configPathsetting, but it invokesloadConfig()without usingpluginConfig.configPath. Consequently, an operator-supplied path intended to select a restricted or trusted AIN configuration has no effect.The loaded configuration is subsequently used to register all configured providers. The routing hook and
ain_runtool may then select those providers and transmit prompts or conversation messages to their configured endpoints.Technical Analysis
A configuration path can act as a security boundary when separate files contain different providers, credentials, endpoint allowlists, or data-handling policies. Ignoring that option causes the plugin to use the dependency's default configuration—documented as
~/.ain/config.yaml—instead of the operator-selected file.This is a fail-open configuration error. The plugin reports successful registration without warning that the requested configuration was not used. The same behavior exists in the distributed runtime at
dist/index.js:10-12.Attack Path
- An operator configures
configPathto point to a restricted AIN configuration containing only approved providers. - The plugin ignores this value and calls
loadConfig()with no path. - A different default AIN configuration is loaded from the environment.
- Providers in that default configuration are registered with OpenClaw.
- The automatic routing hook or an invocation of
ain_runselects one of those providers. - Prompt, system-message, or conversation data is transmitted to an endpoint the operator did not intend ...[truncated 768 chars]
- An operator configures
- Remediation
View remediation
Remediation Suggestions
- Pass the configured path to the AIN configuration loader using the API supported by
@felipematos/ain-cli. - Validate that
configPath, when supplied, is a non-empty string and resolves to the intended file. - Fail closed if an explicitly requested configuration cannot be read or parsed; do not silently fall back to the default configuration.
- Log the resolved configuration path without logging provider credentials or other secrets.
- Consider restricting configuration paths to an operator-approved directory if untrusted parties can modify plugin configuration.
- Add tests verifying that:
- A custom
configPathis passed to the loader. - An invalid explicit path prevents registration.
- Providers from the default configuration are not registered when a custom configuration is selected.
- A custom
- Rebuild
dist/index.jsafter applying the source fix.
- Pass the configured path to the AIN configuration loader using the API supported by
