T09 · Insecure Skill Coding Practices
- Location
config.json:2- Finding
Bundled Volcengine Access Credentials
- Content
View full analysis
配置文件""" ak = os.environ.get('VOLC_AK', '') sk = os.environ.get('VOLC_SK', '') if ak and sk: return ak, sk config_path = SKILL_DIR / 'config.json' if config_path.exists(): try: with open(config_path, 'r') as f: config = json.load(f) ak = config.get('ak', '') sk = config.get('sk', '') if ak and sk: return ak, sk except Exception as e: print(f"[警告] 读取配置文件失败: {e}") raise Exception( "❌ 未配置火山引擎凭证!请通过以下方式之一配置:\n" " 1. 设置环境变量: export VOLC_AK='your_ak' VOLC_SK='your_sk'\n" " 2. 创建配置文件: ~/.openclaw/extensions/volc-digital-human/config.json\n" " 内容: {\"ak\": \"your_ak\", \"sk\": \"your_sk\"}\n" " 3. 获取 AK/SK: https://console.volcengine.com/iam/keymanage/" ) AK, SK = load_credentials() ``` ### Technical Analysis The distributed configuration contains an access-key identifier and an encoded secret-key value. The secret is not protected by encryption: Base64 decoding reveals another Base64 value, which decodes to a 32-character hexadecimal secret. Encoding therefore provides no confidentiality. The script automatically loads these values and uses them as signing credentials for Volcengine API requests. This contradicts the documentation stating that users must configure their own credentials and must not commit AK/SK values. The code does not app ...[truncated 1597 chars]- Remediation
View remediation
