CodeQL Security Scan
trailofbits/skills
Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.
Shows how to replace unsafe hasattr and setattr loops over user-controlled kwargs with an explicit allowlist when configuring ONNX Runtime option objects.
$ npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install microsoft/onnxruntime python-kwargs-setattr-security --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/python-kwargs-setattr-security .claude/skills/python-kwargs-setattr-security && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "python-kwargs-setattr-security" agent skill from https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-security into .claude/skills/python-kwargs-setattr-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-kwargs-setattr-security", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-securityType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install microsoft/onnxruntime python-kwargs-setattr-security --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.github/skills/python-kwargs-setattr-security .agents/skills/python-kwargs-setattr-security && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "python-kwargs-setattr-security" agent skill from https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-security into .agents/skills/python-kwargs-setattr-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-kwargs-setattr-security", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install microsoft/onnxruntime python-kwargs-setattr-security --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.github/skills/python-kwargs-setattr-security .cursor/skills/python-kwargs-setattr-security && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "python-kwargs-setattr-security" agent skill from https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-security into .cursor/skills/python-kwargs-setattr-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-kwargs-setattr-security", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/microsoft/onnxruntime.git --path .github/skills/python-kwargs-setattr-security--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install microsoft/onnxruntime python-kwargs-setattr-security --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.github/skills/python-kwargs-setattr-security .gemini/skills/python-kwargs-setattr-security && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "python-kwargs-setattr-security" agent skill from https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-security into .gemini/skills/python-kwargs-setattr-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-kwargs-setattr-security", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install microsoft/onnxruntime python-kwargs-setattr-securityInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .github/skills && cp -r skills-src/.github/skills/python-kwargs-setattr-security .github/skills/python-kwargs-setattr-security && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "python-kwargs-setattr-security" agent skill from https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-security into .github/skills/python-kwargs-setattr-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-kwargs-setattr-security", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install microsoft/onnxruntime python-kwargs-setattr-security --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/microsoft/onnxruntime.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.github/skills/python-kwargs-setattr-security .opencode/skills/python-kwargs-setattr-security && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "python-kwargs-setattr-security" agent skill from https://github.com/microsoft/onnxruntime/tree/main/.github/skills/python-kwargs-setattr-security into .opencode/skills/python-kwargs-setattr-security/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "python-kwargs-setattr-security", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
python-kwargs-setattr-securityShows how to replace unsafe hasattr and setattr loops over user-controlled kwargs with an explicit allowlist when configuring ONNX Runtime option objects.
The skill explains why forwarding user-controlled kwargs through `hasattr(obj, k)` and `setattr(obj, k, v)` onto C++ extension objects such as SessionOptions and RunOptions is unsafe: `hasattr` is true for every exposed property, including dangerous ones. The fix is a module-level frozenset of safe attribute names. Known-but-blocked attributes raise a RuntimeError, while unknown keys are silently ignored.
Its rules: check against the existing options object instead of constructing a throwaway one per iteration, use RuntimeError for API misuse, allow the silent ignore only when kwargs are forwarded to a second path that validates them, name the constant `_ALLOWED_` plus the class name in capitals, and leave module-level constants without type annotations. Properties that must never be allowlisted include `optimized_model_filepath`, the profiling file prefix together with `enable_profiling`, and `register_custom_ops_library`, since they can overwrite files or load arbitrary shared libraries. The files in ONNX Runtime's Python backend and the matching allowlist test are named.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 8420709. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Python kwargs setattr Allowlist loads about 737 tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 201 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from microsoft/onnxruntime at commit 8420709, republished under its MIT licence (© microsoft). 201 words, ~737 tokens.
.claude/skills/python-kwargs-setattr-security/SKILL.md (or your agent's skills folder).Using hasattr(obj, k) / setattr(obj, k, v) with user-controlled kwargs is insecure. The hasattr check is NOT a security guard — it returns True for ALL exposed properties including dangerous ones.
# INSECURE — do not use
for k, v in kwargs.items():
if hasattr(options, k):
setattr(options, k, v)Define a module-level frozenset of safe attribute names. Raise RuntimeError for known-but-blocked attrs; silently ignore unknown keys.
# Define at module level, before the class
_ALLOWED_SESSION_OPTIONS = frozenset({
"enable_cpu_mem_arena",
"enable_mem_pattern",
# ... only explicitly reviewed safe attrs
})
# In the method
for k, v in kwargs.items():
if k in _ALLOWED_SESSION_OPTIONS:
setattr(options, k, v)
elif hasattr(options, k): # reuse the existing instance, don't create new
raise RuntimeError(
f"SessionOptions attribute '{k}' is not permitted via the backend API. "
f"Allowed attributes: {', '.join(sorted(_ALLOWED_SESSION_OPTIONS))}"
)
# else: silently ignore (may be kwargs for a different config object)hasattr(options, k) — never hasattr(ClassName(), k) (creates throwaway C++ objects per iteration)run_model() passes the same kwargs dict to both prepare() (validates SessionOptions) and rep.run() (validates RunOptions). A RunOptions kwarg unknown to SessionOptions is silently ignored by prepare() — this is correct because rep.run() will validate it. Only raise RuntimeError when the attr exists on the target object but is blocked._ALLOWED_<CLASSNAME> — ALL_CAPS, Google Styleoptimized_model_filepath — triggers Model::Save(), overwrites arbitrary filesprofile_file_prefix + enable_profiling — writes profiling JSON to arbitrary pathregister_custom_ops_library — loads arbitrary shared libraries (method, not property)onnxruntime/python/backend/backend.py — _ALLOWED_SESSION_OPTIONSonnxruntime/python/backend/backend_rep.py — _ALLOWED_RUN_OPTIONSonnxruntime/test/python/onnxruntime_test_python_backend.py — TestBackendKwargsAllowlist© microsoft, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .github/skills/python-kwargs-setattr-security of microsoft/onnxruntime.
Open the folder on GitHubat commit 8420709
Python kwargs setattr Allowlist next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Python kwargs setattr Allowlist this skillmicrosoft/onnxruntime | 22k | — | ~737 | Automated safety check: Pass | MIT | |
| CodeQL Security Scantrailofbits/skills | 7.4k | — | ~4.6k | Automated safety check: Notes | CC-BY-SA-4.0 | |
| Security AuditTheDecipherist/claude-code-mastery | 550 | — | ~1.3k | Automated safety check: Notes | MIT | |
| Agent-Core Security ChecklistopenJiuwen-ai/agent-core | 441 | — | ~1.7k | Automated safety check: Notes | Apache-2.0 | |
| API Security Hardeningsecondsky/claude-skills | 227 | — | ~718 | Automated safety check: Pass | MIT | |
| Security Headers Configurationsecondsky/claude-skills | 227 | — | ~638 | Automated safety check: Pass | MIT |
trailofbits/skills
Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.
TheDecipherist/claude-code-mastery
Checks a codebase for hardcoded secrets, vulnerable dependencies, weak input handling, weak authentication and unsafe transport settings before deployment or merge.
openJiuwen-ai/agent-core
A ten-category security checklist for the agent-core codebase, to run before any security-sensitive change or pull request: secrets, input validation, SQL, access control and prompt injection.
secondsky/claude-skills
REST API security hardening with authentication, rate limiting, input validation, security headers.
secondsky/claude-skills
Configures HTTP security headers to protect against XSS, clickjacking, and MIME sniffing attacks.
eigent-ai/eigent
Audits source code, dependencies and config files for vulnerabilities and hardcoded secrets, using two bundled Python scanners and an OWASP Top 10 checklist.
microsoft/onnxruntime
Finds and fixes out-of-range output writes in ONNX Runtime operator shape-inference functions where a getNumOutputs guard admits too few outputs.
microsoft/onnxruntime
Explains why editing CUTLASS fused-MHA headers in ONNX Runtime can leave stale CUDA kernels after an incremental build, and how to force and verify a real rebuild.
microsoft/onnxruntime
Builds ONNX Runtime from source with its build scripts, explaining the update, build and test phases, key flags and where the build output lands.
microsoft/onnxruntime
Triggers, re-runs and unblocks the CI checks on an ONNX Runtime pull request, after diagnosing whether a failure is transient or needs a code change.
microsoft/onnxruntime
Drafts ONNX Runtime release notes from commit history and contributor metadata using named presets for the full runtime or a scoped component.
microsoft/onnxruntime
Runs and debugs ONNX Runtime tests: Google Test executables for C++ and unittest or pytest for Python, with filters and build-directory guidance.
Categories
Shows how to replace unsafe hasattr and setattr loops over user-controlled kwargs with an explicit allowlist when configuring ONNX Runtime option objects. The skill explains why forwarding user-controlled kwargs through `hasattr(obj, k)` and `setattr(obj, k, v)` onto C++ extension objects such as SessionOptions and RunOptions is unsafe: `hasattr` is true for every exposed property, including dangerous ones. The fix is a module-level frozenset of safe attribute names.
Python kwargs setattr Allowlist fits situations like: reviewing Python code that forwards kwargs to setattr on option objects; fixing an arbitrary-file-write risk in ONNX Runtime backend options; adding a new allowlisted option together with its test.
Run `npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a claude-code`. Or copy the skill folder (.github/skills/python-kwargs-setattr-security in microsoft/onnxruntime) into .claude/skills/python-kwargs-setattr-security in your project. Claude Code loads it when a task matches its description.
Run `npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a codex`. Or copy the skill folder (.github/skills/python-kwargs-setattr-security in microsoft/onnxruntime) into .agents/skills/python-kwargs-setattr-security in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add microsoft/onnxruntime --skill python-kwargs-setattr-security -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/python-kwargs-setattr-security, .gemini/skills/python-kwargs-setattr-security, .github/skills/python-kwargs-setattr-security and .opencode/skills/python-kwargs-setattr-security in your project.
SKILL.md names no scripts, command-line tools or credentials: Python kwargs setattr Allowlist is instructions for the agent only.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Python kwargs setattr Allowlist is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 737 tokens (SKILL.md is roughly 2.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Python kwargs setattr Allowlist: CodeQL Security Scan (trailofbits/skills, 7.4k stars), Security Audit (TheDecipherist/claude-code-mastery, 550 stars), Agent-Core Security Checklist (openJiuwen-ai/agent-core, 441 stars) and API Security Hardening (secondsky/claude-skills, 227 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
microsoft (a GitHub organization, an official publisher) maintains it in microsoft/onnxruntime, which has 22,029 GitHub stars. The repository holds 14 skills in this directory. The repository was last updated on October 7, 2026.
Source: microsoft/onnxruntime on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.