@elizaos/skills 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -0
- package/package.json +53 -0
- package/skills/1password/SKILL.md +70 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/apple-notes/SKILL.md +77 -0
- package/skills/apple-reminders/SKILL.md +96 -0
- package/skills/bear-notes/SKILL.md +107 -0
- package/skills/bird/SKILL.md +224 -0
- package/skills/blogwatcher/SKILL.md +69 -0
- package/skills/blucli/SKILL.md +47 -0
- package/skills/bluebubbles/SKILL.md +131 -0
- package/skills/camsnap/SKILL.md +45 -0
- package/skills/canvas/SKILL.md +203 -0
- package/skills/clawhub/SKILL.md +77 -0
- package/skills/coding-agent/SKILL.md +284 -0
- package/skills/discord/SKILL.md +578 -0
- package/skills/eightctl/SKILL.md +50 -0
- package/skills/food-order/SKILL.md +48 -0
- package/skills/gemini/SKILL.md +43 -0
- package/skills/gifgrep/SKILL.md +79 -0
- package/skills/github/SKILL.md +77 -0
- package/skills/gog/SKILL.md +116 -0
- package/skills/goplaces/SKILL.md +52 -0
- package/skills/healthcheck/SKILL.md +245 -0
- package/skills/himalaya/SKILL.md +257 -0
- package/skills/himalaya/references/configuration.md +184 -0
- package/skills/himalaya/references/message-composition.md +199 -0
- package/skills/imsg/SKILL.md +74 -0
- package/skills/local-places/SERVER_README.md +101 -0
- package/skills/local-places/SKILL.md +102 -0
- package/skills/local-places/pyproject.toml +21 -0
- package/skills/local-places/src/local_places/__init__.py +2 -0
- package/skills/local-places/src/local_places/google_places.py +314 -0
- package/skills/local-places/src/local_places/main.py +65 -0
- package/skills/local-places/src/local_places/schemas.py +107 -0
- package/skills/mcporter/SKILL.md +61 -0
- package/skills/model-usage/SKILL.md +69 -0
- package/skills/model-usage/references/codexbar-cli.md +33 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/nano-banana-pro/SKILL.md +58 -0
- package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
- package/skills/nano-pdf/SKILL.md +38 -0
- package/skills/notion/SKILL.md +172 -0
- package/skills/obsidian/SKILL.md +81 -0
- package/skills/openai-image-gen/SKILL.md +89 -0
- package/skills/openai-image-gen/scripts/gen.py +240 -0
- package/skills/openai-whisper/SKILL.md +38 -0
- package/skills/openai-whisper-api/SKILL.md +52 -0
- package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
- package/skills/openhue/SKILL.md +51 -0
- package/skills/oracle/SKILL.md +125 -0
- package/skills/ordercli/SKILL.md +78 -0
- package/skills/peekaboo/SKILL.md +190 -0
- package/skills/sag/SKILL.md +87 -0
- package/skills/security-ask-questions-if-underspecified/.claude-plugin/plugin.json +10 -0
- package/skills/security-ask-questions-if-underspecified/README.md +24 -0
- package/skills/security-ask-questions-if-underspecified/skills/ask-questions-if-underspecified/SKILL.md +85 -0
- package/skills/security-audit-context-building/.claude-plugin/plugin.json +10 -0
- package/skills/security-audit-context-building/README.md +58 -0
- package/skills/security-audit-context-building/commands/audit-context.md +21 -0
- package/skills/security-audit-context-building/skills/audit-context-building/SKILL.md +297 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/COMPLETENESS_CHECKLIST.md +47 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/FUNCTION_MICRO_ANALYSIS_EXAMPLE.md +355 -0
- package/skills/security-audit-context-building/skills/audit-context-building/resources/OUTPUT_REQUIREMENTS.md +71 -0
- package/skills/security-building-secure-contracts/.claude-plugin/plugin.json +10 -0
- package/skills/security-building-secure-contracts/README.md +241 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/SKILL.md +284 -0
- package/skills/security-building-secure-contracts/skills/algorand-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +405 -0
- package/skills/security-building-secure-contracts/skills/audit-prep-assistant/SKILL.md +409 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/SKILL.md +329 -0
- package/skills/security-building-secure-contracts/skills/cairo-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +722 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/SKILL.md +218 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/ASSESSMENT_CRITERIA.md +355 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/EXAMPLE_REPORT.md +248 -0
- package/skills/security-building-secure-contracts/skills/code-maturity-assessor/resources/REPORT_FORMAT.md +33 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/SKILL.md +334 -0
- package/skills/security-building-secure-contracts/skills/cosmos-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +740 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/SKILL.md +252 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/ASSESSMENT_AREAS.md +329 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/DELIVERABLES.md +118 -0
- package/skills/security-building-secure-contracts/skills/guidelines-advisor/resources/EXAMPLE_REPORT.md +298 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/SKILL.md +161 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/EXAMPLE_REPORT.md +279 -0
- package/skills/security-building-secure-contracts/skills/secure-workflow-guide/resources/WORKFLOW_STEPS.md +132 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/SKILL.md +389 -0
- package/skills/security-building-secure-contracts/skills/solana-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +669 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/SKILL.md +298 -0
- package/skills/security-building-secure-contracts/skills/substrate-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +791 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/SKILL.md +362 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/ASSESSMENT_CATEGORIES.md +571 -0
- package/skills/security-building-secure-contracts/skills/token-integration-analyzer/resources/REPORT_TEMPLATES.md +141 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/SKILL.md +388 -0
- package/skills/security-building-secure-contracts/skills/ton-vulnerability-scanner/resources/VULNERABILITY_PATTERNS.md +595 -0
- package/skills/security-burpsuite-project-parser/.claude-plugin/plugin.json +10 -0
- package/skills/security-burpsuite-project-parser/README.md +103 -0
- package/skills/security-burpsuite-project-parser/commands/burp-search.md +18 -0
- package/skills/security-burpsuite-project-parser/skills/SKILL.md +358 -0
- package/skills/security-burpsuite-project-parser/skills/scripts/burp-search.sh +99 -0
- package/skills/security-claude-in-chrome-troubleshooting/.claude-plugin/plugin.json +8 -0
- package/skills/security-claude-in-chrome-troubleshooting/README.md +31 -0
- package/skills/security-claude-in-chrome-troubleshooting/skills/claude-in-chrome-troubleshooting/SKILL.md +251 -0
- package/skills/security-constant-time-analysis/.claude-plugin/plugin.json +9 -0
- package/skills/security-constant-time-analysis/README.md +381 -0
- package/skills/security-constant-time-analysis/commands/ct-check.md +20 -0
- package/skills/security-constant-time-analysis/ct_analyzer/__init__.py +49 -0
- package/skills/security-constant-time-analysis/ct_analyzer/analyzer.py +1284 -0
- package/skills/security-constant-time-analysis/ct_analyzer/script_analyzers.py +3081 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/__init__.py +1 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_analyzer.py +1397 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/bn_excerpt.js +205 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_constant_time.c +181 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_vulnerable.c +74 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_vulnerable.go +78 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/decompose_vulnerable.rs +92 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.cs +174 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.java +161 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.kt +181 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.php +140 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.py +252 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.rb +188 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.swift +199 -0
- package/skills/security-constant-time-analysis/ct_analyzer/tests/test_samples/vulnerable.ts +154 -0
- package/skills/security-constant-time-analysis/pyproject.toml +52 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/README.md +90 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/SKILL.md +219 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/compiled.md +129 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/javascript.md +136 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/kotlin.md +252 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/php.md +172 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/python.md +179 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/ruby.md +198 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/swift.md +288 -0
- package/skills/security-constant-time-analysis/skills/constant-time-analysis/references/vm-compiled.md +354 -0
- package/skills/security-constant-time-analysis/uv.lock +8 -0
- package/skills/security-culture-index/.claude-plugin/plugin.json +8 -0
- package/skills/security-culture-index/README.md +79 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/SKILL.md +293 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/anti-patterns.md +255 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/conversation-starters.md +408 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/interview-trait-signals.md +253 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/motivators.md +158 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/patterns-archetypes.md +147 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/primary-traits.md +307 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/secondary-traits.md +228 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/references/team-composition.md +148 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/check_deps.py +108 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/__init__.py +20 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/constants.py +122 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/extract.py +187 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/models.py +16 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/culture_index/opencv_extractor.py +520 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/extract_pdf.py +237 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/scripts/pyproject.toml +18 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/templates/burnout-report.md +113 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/templates/comparison-report.md +103 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/templates/hiring-profile.md +127 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/templates/individual-report.md +85 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/templates/predicted-profile.md +165 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/templates/team-report.md +109 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/analyze-team.md +188 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/coach-manager.md +267 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/compare-profiles.md +188 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/define-hiring-profile.md +220 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/detect-burnout.md +206 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/extract-from-pdf.md +121 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/interpret-individual.md +183 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/interview-debrief.md +234 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/mediate-conflict.md +306 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/plan-onboarding.md +322 -0
- package/skills/security-culture-index/skills/interpreting-culture-index/workflows/predict-from-interview.md +250 -0
- package/skills/security-differential-review/.claude-plugin/plugin.json +10 -0
- package/skills/security-differential-review/README.md +109 -0
- package/skills/security-differential-review/commands/diff-review.md +21 -0
- package/skills/security-differential-review/skills/differential-review/SKILL.md +220 -0
- package/skills/security-differential-review/skills/differential-review/adversarial.md +203 -0
- package/skills/security-differential-review/skills/differential-review/methodology.md +234 -0
- package/skills/security-differential-review/skills/differential-review/patterns.md +300 -0
- package/skills/security-differential-review/skills/differential-review/reporting.md +369 -0
- package/skills/security-dwarf-expert/.claude-plugin/plugin.json +10 -0
- package/skills/security-dwarf-expert/README.md +38 -0
- package/skills/security-dwarf-expert/skills/dwarf-expert/SKILL.md +93 -0
- package/skills/security-dwarf-expert/skills/dwarf-expert/reference/coding.md +31 -0
- package/skills/security-dwarf-expert/skills/dwarf-expert/reference/dwarfdump.md +50 -0
- package/skills/security-dwarf-expert/skills/dwarf-expert/reference/readelf.md +8 -0
- package/skills/security-entry-point-analyzer/.claude-plugin/plugin.json +10 -0
- package/skills/security-entry-point-analyzer/README.md +74 -0
- package/skills/security-entry-point-analyzer/commands/entry-points.md +18 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/SKILL.md +251 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/cosmwasm.md +182 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-aptos.md +107 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/move-sui.md +87 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solana.md +155 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/solidity.md +135 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/ton.md +185 -0
- package/skills/security-entry-point-analyzer/skills/entry-point-analyzer/references/vyper.md +141 -0
- package/skills/security-firebase-apk-scanner/.claude-plugin/plugin.json +10 -0
- package/skills/security-firebase-apk-scanner/README.md +85 -0
- package/skills/security-firebase-apk-scanner/commands/scan-apk.md +18 -0
- package/skills/security-firebase-apk-scanner/scanner.sh +1408 -0
- package/skills/security-firebase-apk-scanner/skills/firebase-apk-scanner/SKILL.md +197 -0
- package/skills/security-firebase-apk-scanner/skills/firebase-apk-scanner/references/vulnerabilities.md +803 -0
- package/skills/security-fix-review/.claude-plugin/plugin.json +13 -0
- package/skills/security-fix-review/README.md +118 -0
- package/skills/security-fix-review/commands/fix-review.md +24 -0
- package/skills/security-fix-review/skills/fix-review/SKILL.md +264 -0
- package/skills/security-fix-review/skills/fix-review/references/bug-detection.md +408 -0
- package/skills/security-fix-review/skills/fix-review/references/finding-matching.md +298 -0
- package/skills/security-fix-review/skills/fix-review/references/report-parsing.md +398 -0
- package/skills/security-insecure-defaults/.claude-plugin/plugin.json +10 -0
- package/skills/security-insecure-defaults/README.md +45 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/SKILL.md +117 -0
- package/skills/security-insecure-defaults/skills/insecure-defaults/references/examples.md +409 -0
- package/skills/security-modern-python/.claude-plugin/plugin.json +10 -0
- package/skills/security-modern-python/README.md +58 -0
- package/skills/security-modern-python/hooks/hooks.json +16 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.bats +388 -0
- package/skills/security-modern-python/hooks/intercept-legacy-python.sh +109 -0
- package/skills/security-modern-python/hooks/test_helper.bash +75 -0
- package/skills/security-modern-python/skills/modern-python/SKILL.md +333 -0
- package/skills/security-modern-python/skills/modern-python/references/dependabot.md +43 -0
- package/skills/security-modern-python/skills/modern-python/references/migration-checklist.md +141 -0
- package/skills/security-modern-python/skills/modern-python/references/pep723-scripts.md +259 -0
- package/skills/security-modern-python/skills/modern-python/references/prek.md +211 -0
- package/skills/security-modern-python/skills/modern-python/references/pyproject.md +254 -0
- package/skills/security-modern-python/skills/modern-python/references/ruff-config.md +240 -0
- package/skills/security-modern-python/skills/modern-python/references/security-setup.md +255 -0
- package/skills/security-modern-python/skills/modern-python/references/testing.md +284 -0
- package/skills/security-modern-python/skills/modern-python/references/uv-commands.md +200 -0
- package/skills/security-modern-python/skills/modern-python/templates/dependabot.yml +36 -0
- package/skills/security-modern-python/skills/modern-python/templates/pre-commit-config.yaml +66 -0
- package/skills/security-property-based-testing/.claude-plugin/plugin.json +9 -0
- package/skills/security-property-based-testing/README.md +47 -0
- package/skills/security-property-based-testing/skills/property-based-testing/README.md +88 -0
- package/skills/security-property-based-testing/skills/property-based-testing/SKILL.md +109 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/design.md +191 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/generating.md +200 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/libraries.md +130 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/refactoring.md +181 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/reviewing.md +209 -0
- package/skills/security-property-based-testing/skills/property-based-testing/references/strategies.md +124 -0
- package/skills/semgrep-rule-creator/.claude-plugin/plugin.json +8 -0
- package/skills/semgrep-rule-creator/README.md +43 -0
- package/skills/semgrep-rule-creator/commands/semgrep-rule.md +26 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/SKILL.md +168 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/quick-reference.md +203 -0
- package/skills/semgrep-rule-creator/skills/semgrep-rule-creator/references/workflow.md +240 -0
- package/skills/semgrep-rule-variant-creator/.claude-plugin/plugin.json +9 -0
- package/skills/semgrep-rule-variant-creator/README.md +86 -0
- package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/SKILL.md +205 -0
- package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/applicability-analysis.md +250 -0
- package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/language-syntax-guide.md +324 -0
- package/skills/semgrep-rule-variant-creator/skills/semgrep-rule-variant-creator/references/workflow.md +518 -0
- package/skills/session-logs/SKILL.md +115 -0
- package/skills/sharp-edges/.claude-plugin/plugin.json +10 -0
- package/skills/sharp-edges/README.md +48 -0
- package/skills/sharp-edges/skills/sharp-edges/SKILL.md +292 -0
- package/skills/sharp-edges/skills/sharp-edges/references/auth-patterns.md +252 -0
- package/skills/sharp-edges/skills/sharp-edges/references/case-studies.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/config-patterns.md +333 -0
- package/skills/sharp-edges/skills/sharp-edges/references/crypto-apis.md +190 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-c.md +205 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-csharp.md +285 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-go.md +270 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-java.md +263 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-javascript.md +269 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-kotlin.md +265 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-php.md +245 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-python.md +274 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-ruby.md +273 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-rust.md +272 -0
- package/skills/sharp-edges/skills/sharp-edges/references/lang-swift.md +287 -0
- package/skills/sharp-edges/skills/sharp-edges/references/language-specific.md +588 -0
- package/skills/sherpa-onnx-tts/SKILL.md +103 -0
- package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
- package/skills/skill-creator/SKILL.md +370 -0
- package/skills/skill-creator/license.txt +202 -0
- package/skills/skill-creator/scripts/init_skill.py +378 -0
- package/skills/skill-creator/scripts/package_skill.py +111 -0
- package/skills/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/slack/SKILL.md +144 -0
- package/skills/songsee/SKILL.md +49 -0
- package/skills/sonoscli/SKILL.md +46 -0
- package/skills/spec-to-code-compliance/.claude-plugin/plugin.json +10 -0
- package/skills/spec-to-code-compliance/README.md +67 -0
- package/skills/spec-to-code-compliance/commands/spec-compliance.md +22 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/SKILL.md +349 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/COMPLETENESS_CHECKLIST.md +69 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/IR_EXAMPLES.md +417 -0
- package/skills/spec-to-code-compliance/skills/spec-to-code-compliance/resources/OUTPUT_REQUIREMENTS.md +105 -0
- package/skills/spotify-player/SKILL.md +64 -0
- package/skills/static-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/static-analysis/README.md +59 -0
- package/skills/static-analysis/skills/codeql/SKILL.md +315 -0
- package/skills/static-analysis/skills/sarif-parsing/SKILL.md +479 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/jq-queries.md +162 -0
- package/skills/static-analysis/skills/sarif-parsing/resources/sarif_helpers.py +331 -0
- package/skills/static-analysis/skills/semgrep/SKILL.md +337 -0
- package/skills/summarize/SKILL.md +87 -0
- package/skills/testing-handbook-skills/.claude-plugin/plugin.json +8 -0
- package/skills/testing-handbook-skills/README.md +241 -0
- package/skills/testing-handbook-skills/scripts/pyproject.toml +8 -0
- package/skills/testing-handbook-skills/scripts/validate-skills.py +657 -0
- package/skills/testing-handbook-skills/skills/address-sanitizer/SKILL.md +341 -0
- package/skills/testing-handbook-skills/skills/aflpp/SKILL.md +640 -0
- package/skills/testing-handbook-skills/skills/atheris/SKILL.md +515 -0
- package/skills/testing-handbook-skills/skills/cargo-fuzz/SKILL.md +454 -0
- package/skills/testing-handbook-skills/skills/codeql/SKILL.md +549 -0
- package/skills/testing-handbook-skills/skills/constant-time-testing/SKILL.md +507 -0
- package/skills/testing-handbook-skills/skills/coverage-analysis/SKILL.md +607 -0
- package/skills/testing-handbook-skills/skills/fuzzing-dictionary/SKILL.md +297 -0
- package/skills/testing-handbook-skills/skills/fuzzing-obstacles/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/harness-writing/SKILL.md +614 -0
- package/skills/testing-handbook-skills/skills/libafl/SKILL.md +625 -0
- package/skills/testing-handbook-skills/skills/libfuzzer/SKILL.md +795 -0
- package/skills/testing-handbook-skills/skills/ossfuzz/SKILL.md +426 -0
- package/skills/testing-handbook-skills/skills/ruzzy/SKILL.md +443 -0
- package/skills/testing-handbook-skills/skills/semgrep/SKILL.md +601 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/SKILL.md +372 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/agent-prompt.md +280 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/discovery.md +452 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/domain-skill.md +504 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/fuzzer-skill.md +454 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/technique-skill.md +527 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/templates/tool-skill.md +366 -0
- package/skills/testing-handbook-skills/skills/testing-handbook-generator/testing.md +482 -0
- package/skills/testing-handbook-skills/skills/wycheproof/SKILL.md +533 -0
- package/skills/things-mac/SKILL.md +86 -0
- package/skills/tmux/SKILL.md +135 -0
- package/skills/tmux/scripts/find-sessions.sh +112 -0
- package/skills/tmux/scripts/wait-for-text.sh +83 -0
- package/skills/trello/SKILL.md +95 -0
- package/skills/variant-analysis/.claude-plugin/plugin.json +8 -0
- package/skills/variant-analysis/README.md +41 -0
- package/skills/variant-analysis/commands/variants.md +23 -0
- package/skills/variant-analysis/skills/variant-analysis/METHODOLOGY.md +327 -0
- package/skills/variant-analysis/skills/variant-analysis/SKILL.md +142 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/cpp.ql +119 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/go.ql +69 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/java.ql +71 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/javascript.ql +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/codeql/python.ql +80 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/cpp.yaml +98 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/go.yaml +63 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/java.yaml +61 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/javascript.yaml +60 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/semgrep/python.yaml +72 -0
- package/skills/variant-analysis/skills/variant-analysis/resources/variant-report-template.md +75 -0
- package/skills/video-frames/SKILL.md +46 -0
- package/skills/video-frames/scripts/frame.sh +81 -0
- package/skills/voice-call/SKILL.md +45 -0
- package/skills/wacli/SKILL.md +72 -0
- package/skills/weather/SKILL.md +54 -0
- package/skills/yara-authoring/.claude-plugin/plugin.json +9 -0
- package/skills/yara-authoring/README.md +131 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/SKILL.md +645 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/examples/MAL_Mac_ProtonRAT_Jan25.yar +99 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/examples/MAL_NPM_SupplyChain_Jan25.yar +170 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/examples/MAL_Win_Remcos_Jan25.yar +103 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/examples/SUSP_CRX_SuspiciousPermissions.yar +134 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/examples/SUSP_JS_Obfuscation_Jan25.yar +185 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/references/crx-module.md +214 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/references/dex-module.md +383 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/references/performance.md +333 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/references/strings.md +433 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/references/style-guide.md +257 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/references/testing.md +399 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/scripts/atom_analyzer.py +526 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/scripts/pyproject.toml +25 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/scripts/yara_lint.py +631 -0
- package/skills/yara-authoring/skills/yara-rule-authoring/workflows/rule-development.md +493 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vulnerable C# code sample for constant-time analysis testing.
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates common timing side-channel vulnerabilities in C#:
|
|
5
|
+
* - Variable-time division operations
|
|
6
|
+
* - Timing-unsafe comparisons
|
|
7
|
+
* - Variable-latency math operations
|
|
8
|
+
* - Predictable randomness
|
|
9
|
+
*
|
|
10
|
+
* DO NOT USE THIS CODE IN PRODUCTION - it is intentionally vulnerable.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
using System;
|
|
14
|
+
using System.Linq;
|
|
15
|
+
|
|
16
|
+
public class Vulnerable
|
|
17
|
+
{
|
|
18
|
+
/// <summary>
|
|
19
|
+
/// Vulnerable modular reduction using division.
|
|
20
|
+
/// Division has data-dependent timing on most platforms.
|
|
21
|
+
/// </summary>
|
|
22
|
+
public static int VulnerableModReduce(int value, int modulus)
|
|
23
|
+
{
|
|
24
|
+
// VULNERABLE: Division has variable-time execution (div opcode)
|
|
25
|
+
int quotient = value / modulus;
|
|
26
|
+
// VULNERABLE: Modulo has variable-time execution (rem opcode)
|
|
27
|
+
int remainder = value % modulus;
|
|
28
|
+
|
|
29
|
+
// Use quotient to prevent dead code elimination
|
|
30
|
+
if (quotient < 0)
|
|
31
|
+
{
|
|
32
|
+
throw new ArgumentException("Unexpected negative quotient");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return remainder;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/// <summary>
|
|
39
|
+
/// Vulnerable long division.
|
|
40
|
+
/// Long division also has timing side-channels.
|
|
41
|
+
/// </summary>
|
|
42
|
+
public static long VulnerableLongDivide(long value, long divisor)
|
|
43
|
+
{
|
|
44
|
+
// VULNERABLE: Long division has variable-time execution
|
|
45
|
+
return value / divisor;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/// <summary>
|
|
49
|
+
/// Vulnerable floating-point division.
|
|
50
|
+
/// </summary>
|
|
51
|
+
public static double VulnerableFloatDivide(double a, double b)
|
|
52
|
+
{
|
|
53
|
+
// VULNERABLE: Float division has variable latency
|
|
54
|
+
return a / b;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/// <summary>
|
|
58
|
+
/// Vulnerable token comparison using SequenceEqual().
|
|
59
|
+
/// This leaks timing information about how many bytes match.
|
|
60
|
+
/// </summary>
|
|
61
|
+
public static bool VulnerableTokenCompare(byte[] provided, byte[] expected)
|
|
62
|
+
{
|
|
63
|
+
// VULNERABLE: SequenceEqual() may early-exit on mismatch
|
|
64
|
+
return provided.SequenceEqual(expected);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/// <summary>
|
|
68
|
+
/// Vulnerable string comparison using Equals().
|
|
69
|
+
/// String.Equals() has early-exit behavior.
|
|
70
|
+
/// </summary>
|
|
71
|
+
public static bool VulnerableStringCompare(string provided, string expected)
|
|
72
|
+
{
|
|
73
|
+
// VULNERABLE: String.Equals() may early-exit
|
|
74
|
+
return provided.Equals(expected);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// <summary>
|
|
78
|
+
/// Vulnerable square root calculation.
|
|
79
|
+
/// Math.Sqrt() has variable latency based on operand values.
|
|
80
|
+
/// </summary>
|
|
81
|
+
public static double VulnerableSqrt(double value)
|
|
82
|
+
{
|
|
83
|
+
// VULNERABLE: Math.Sqrt has variable latency
|
|
84
|
+
return Math.Sqrt(value);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/// <summary>
|
|
88
|
+
/// Vulnerable power calculation.
|
|
89
|
+
/// Math.Pow() has variable latency based on operand values.
|
|
90
|
+
/// </summary>
|
|
91
|
+
public static double VulnerablePow(double baseVal, double exponent)
|
|
92
|
+
{
|
|
93
|
+
// VULNERABLE: Math.Pow has variable latency
|
|
94
|
+
return Math.Pow(baseVal, exponent);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// <summary>
|
|
98
|
+
/// Vulnerable random number generation.
|
|
99
|
+
/// System.Random is predictable and not cryptographically secure.
|
|
100
|
+
/// </summary>
|
|
101
|
+
public static int VulnerableRandomInt(int maxValue)
|
|
102
|
+
{
|
|
103
|
+
// VULNERABLE: System.Random is predictable
|
|
104
|
+
Random rand = new Random();
|
|
105
|
+
return rand.Next(maxValue);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// <summary>
|
|
109
|
+
/// Vulnerable decompose function similar to ML-DSA.
|
|
110
|
+
/// Demonstrates the KyberSlash-style vulnerability.
|
|
111
|
+
/// </summary>
|
|
112
|
+
public static (int r1, int r0) VulnerableDecompose(int r, int gamma2)
|
|
113
|
+
{
|
|
114
|
+
// VULNERABLE: Division has variable-time execution
|
|
115
|
+
int r1 = (r + 127) / (2 * gamma2);
|
|
116
|
+
|
|
117
|
+
// VULNERABLE: Modulo has variable-time execution
|
|
118
|
+
int r0 = r % (2 * gamma2);
|
|
119
|
+
|
|
120
|
+
// Centering
|
|
121
|
+
if (r0 > gamma2)
|
|
122
|
+
{
|
|
123
|
+
r0 -= 2 * gamma2;
|
|
124
|
+
r1 += 1;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return (r1, r0);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/// <summary>
|
|
131
|
+
/// Vulnerable table lookup using secret as index.
|
|
132
|
+
/// This leaks timing through cache behavior.
|
|
133
|
+
/// </summary>
|
|
134
|
+
public static int VulnerableTableLookup(int secretIndex, int[] table)
|
|
135
|
+
{
|
|
136
|
+
// VULNERABLE: Array access indexed by secret leaks cache timing
|
|
137
|
+
return table[secretIndex];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/// <summary>
|
|
141
|
+
/// Test harness to prevent dead code elimination.
|
|
142
|
+
/// </summary>
|
|
143
|
+
public static void Main(string[] args)
|
|
144
|
+
{
|
|
145
|
+
Console.WriteLine("Running vulnerable operations for testing...");
|
|
146
|
+
|
|
147
|
+
int result1 = VulnerableModReduce(12345, 97);
|
|
148
|
+
Console.WriteLine($"Mod reduce: {result1}");
|
|
149
|
+
|
|
150
|
+
long result2 = VulnerableLongDivide(1234567890L, 12345L);
|
|
151
|
+
Console.WriteLine($"Long divide: {result2}");
|
|
152
|
+
|
|
153
|
+
double result3 = VulnerableFloatDivide(10.0, 3.0);
|
|
154
|
+
Console.WriteLine($"Float divide: {result3}");
|
|
155
|
+
|
|
156
|
+
byte[] a = { 1, 2, 3 };
|
|
157
|
+
byte[] b = { 1, 2, 3 };
|
|
158
|
+
bool result4 = VulnerableTokenCompare(a, b);
|
|
159
|
+
Console.WriteLine($"Token compare: {result4}");
|
|
160
|
+
|
|
161
|
+
double result5 = VulnerableSqrt(144);
|
|
162
|
+
Console.WriteLine($"Sqrt: {result5}");
|
|
163
|
+
|
|
164
|
+
int result6 = VulnerableRandomInt(100);
|
|
165
|
+
Console.WriteLine($"Random: {result6}");
|
|
166
|
+
|
|
167
|
+
var result7 = VulnerableDecompose(1000, 261888);
|
|
168
|
+
Console.WriteLine($"Decompose: r1={result7.r1}, r0={result7.r0}");
|
|
169
|
+
|
|
170
|
+
int[] table = { 1, 2, 3, 4, 5, 6, 7, 8 };
|
|
171
|
+
int result8 = VulnerableTableLookup(5, table);
|
|
172
|
+
Console.WriteLine($"Table lookup: {result8}");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vulnerable Java code sample for constant-time analysis testing.
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates common timing side-channel vulnerabilities in Java:
|
|
5
|
+
* - Variable-time division operations
|
|
6
|
+
* - Timing-unsafe comparisons
|
|
7
|
+
* - Variable-latency math operations
|
|
8
|
+
* - Predictable randomness
|
|
9
|
+
*
|
|
10
|
+
* DO NOT USE THIS CODE IN PRODUCTION - it is intentionally vulnerable.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import java.util.Arrays;
|
|
14
|
+
import java.util.Random;
|
|
15
|
+
|
|
16
|
+
public class vulnerable {
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Vulnerable modular reduction using division.
|
|
20
|
+
* Division has data-dependent timing on most platforms.
|
|
21
|
+
*/
|
|
22
|
+
public static int vulnerableModReduce(int value, int modulus) {
|
|
23
|
+
// VULNERABLE: Division has variable-time execution (idiv bytecode)
|
|
24
|
+
int quotient = value / modulus;
|
|
25
|
+
// VULNERABLE: Modulo has variable-time execution (irem bytecode)
|
|
26
|
+
int remainder = value % modulus;
|
|
27
|
+
|
|
28
|
+
// Use quotient to prevent dead code elimination
|
|
29
|
+
if (quotient < 0) {
|
|
30
|
+
throw new IllegalArgumentException("Unexpected negative quotient");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return remainder;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Vulnerable long division.
|
|
38
|
+
* Long division (ldiv) also has timing side-channels.
|
|
39
|
+
*/
|
|
40
|
+
public static long vulnerableLongDivide(long value, long divisor) {
|
|
41
|
+
// VULNERABLE: Long division has variable-time execution (ldiv bytecode)
|
|
42
|
+
return value / divisor;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Vulnerable floating-point division.
|
|
47
|
+
*/
|
|
48
|
+
public static double vulnerableFloatDivide(double a, double b) {
|
|
49
|
+
// VULNERABLE: Float division has variable latency (ddiv bytecode)
|
|
50
|
+
return a / b;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Vulnerable token comparison using Arrays.equals().
|
|
55
|
+
* This leaks timing information about how many bytes match.
|
|
56
|
+
*/
|
|
57
|
+
public static boolean vulnerableTokenCompare(byte[] provided, byte[] expected) {
|
|
58
|
+
// VULNERABLE: Arrays.equals() may early-exit on mismatch
|
|
59
|
+
return Arrays.equals(provided, expected);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Vulnerable string comparison using equals().
|
|
64
|
+
* String.equals() has early-exit behavior.
|
|
65
|
+
*/
|
|
66
|
+
public static boolean vulnerableStringCompare(String provided, String expected) {
|
|
67
|
+
// VULNERABLE: String.equals() may early-exit
|
|
68
|
+
return provided.equals(expected);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Vulnerable square root calculation.
|
|
73
|
+
* Math.sqrt() has variable latency based on operand values.
|
|
74
|
+
*/
|
|
75
|
+
public static double vulnerableSqrt(double value) {
|
|
76
|
+
// VULNERABLE: Math.sqrt has variable latency
|
|
77
|
+
return Math.sqrt(value);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Vulnerable power calculation.
|
|
82
|
+
* Math.pow() has variable latency based on operand values.
|
|
83
|
+
*/
|
|
84
|
+
public static double vulnerablePow(double base, double exponent) {
|
|
85
|
+
// VULNERABLE: Math.pow has variable latency
|
|
86
|
+
return Math.pow(base, exponent);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Vulnerable random number generation.
|
|
91
|
+
* java.util.Random is predictable and not cryptographically secure.
|
|
92
|
+
*/
|
|
93
|
+
public static int vulnerableRandomInt(int bound) {
|
|
94
|
+
// VULNERABLE: java.util.Random is predictable
|
|
95
|
+
Random rand = new Random();
|
|
96
|
+
return rand.nextInt(bound);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Vulnerable decompose function similar to ML-DSA.
|
|
101
|
+
* Demonstrates the KyberSlash-style vulnerability.
|
|
102
|
+
*/
|
|
103
|
+
public static int[] vulnerableDecompose(int r, int gamma2) {
|
|
104
|
+
// VULNERABLE: Division has variable-time execution
|
|
105
|
+
int r1 = (r + 127) / (2 * gamma2);
|
|
106
|
+
|
|
107
|
+
// VULNERABLE: Modulo has variable-time execution
|
|
108
|
+
int r0 = r % (2 * gamma2);
|
|
109
|
+
|
|
110
|
+
// Centering
|
|
111
|
+
if (r0 > gamma2) {
|
|
112
|
+
r0 -= 2 * gamma2;
|
|
113
|
+
r1 += 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return new int[]{r1, r0};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Vulnerable table lookup using secret as index.
|
|
121
|
+
* This leaks timing through cache behavior.
|
|
122
|
+
*/
|
|
123
|
+
public static int vulnerableTableLookup(int secretIndex, int[] table) {
|
|
124
|
+
// VULNERABLE: Array access indexed by secret leaks cache timing
|
|
125
|
+
return table[secretIndex];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Test harness to prevent dead code elimination.
|
|
130
|
+
*/
|
|
131
|
+
public static void main(String[] args) {
|
|
132
|
+
System.out.println("Running vulnerable operations for testing...");
|
|
133
|
+
|
|
134
|
+
int result1 = vulnerableModReduce(12345, 97);
|
|
135
|
+
System.out.println("Mod reduce: " + result1);
|
|
136
|
+
|
|
137
|
+
long result2 = vulnerableLongDivide(1234567890L, 12345L);
|
|
138
|
+
System.out.println("Long divide: " + result2);
|
|
139
|
+
|
|
140
|
+
double result3 = vulnerableFloatDivide(10.0, 3.0);
|
|
141
|
+
System.out.println("Float divide: " + result3);
|
|
142
|
+
|
|
143
|
+
byte[] a = {1, 2, 3};
|
|
144
|
+
byte[] b = {1, 2, 3};
|
|
145
|
+
boolean result4 = vulnerableTokenCompare(a, b);
|
|
146
|
+
System.out.println("Token compare: " + result4);
|
|
147
|
+
|
|
148
|
+
double result5 = vulnerableSqrt(144);
|
|
149
|
+
System.out.println("Sqrt: " + result5);
|
|
150
|
+
|
|
151
|
+
int result6 = vulnerableRandomInt(100);
|
|
152
|
+
System.out.println("Random: " + result6);
|
|
153
|
+
|
|
154
|
+
int[] result7 = vulnerableDecompose(1000, 261888);
|
|
155
|
+
System.out.println("Decompose: r1=" + result7[0] + ", r0=" + result7[1]);
|
|
156
|
+
|
|
157
|
+
int[] table = {1, 2, 3, 4, 5, 6, 7, 8};
|
|
158
|
+
int result8 = vulnerableTableLookup(5, table);
|
|
159
|
+
System.out.println("Table lookup: " + result8);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vulnerable Kotlin code sample for constant-time analysis testing.
|
|
3
|
+
*
|
|
4
|
+
* This file demonstrates common timing side-channel vulnerabilities in Kotlin:
|
|
5
|
+
* - Variable-time division operations
|
|
6
|
+
* - Timing-unsafe comparisons
|
|
7
|
+
* - Variable-latency math operations
|
|
8
|
+
* - Predictable randomness
|
|
9
|
+
*
|
|
10
|
+
* DO NOT USE THIS CODE IN PRODUCTION - it is intentionally vulnerable.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import kotlin.random.Random
|
|
14
|
+
import kotlin.math.sqrt
|
|
15
|
+
import kotlin.math.pow
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Vulnerable modular reduction using division.
|
|
19
|
+
* Division has data-dependent timing on most platforms.
|
|
20
|
+
*/
|
|
21
|
+
fun vulnerableModReduce(value: Int, modulus: Int): Int {
|
|
22
|
+
// VULNERABLE: Division has variable-time execution (idiv bytecode)
|
|
23
|
+
val quotient = value / modulus
|
|
24
|
+
// VULNERABLE: Modulo has variable-time execution (irem bytecode)
|
|
25
|
+
val remainder = value % modulus
|
|
26
|
+
|
|
27
|
+
// Use quotient to prevent dead code elimination
|
|
28
|
+
require(quotient >= 0) { "Unexpected negative quotient" }
|
|
29
|
+
|
|
30
|
+
return remainder
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Vulnerable long division.
|
|
35
|
+
* Long division (ldiv) also has timing side-channels.
|
|
36
|
+
*/
|
|
37
|
+
fun vulnerableLongDivide(value: Long, divisor: Long): Long {
|
|
38
|
+
// VULNERABLE: Long division has variable-time execution (ldiv bytecode)
|
|
39
|
+
return value / divisor
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Vulnerable floating-point division.
|
|
44
|
+
*/
|
|
45
|
+
fun vulnerableFloatDivide(a: Double, b: Double): Double {
|
|
46
|
+
// VULNERABLE: Float division has variable latency (ddiv bytecode)
|
|
47
|
+
return a / b
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Vulnerable token comparison using contentEquals().
|
|
52
|
+
* This leaks timing information about how many bytes match.
|
|
53
|
+
*/
|
|
54
|
+
fun vulnerableTokenCompare(provided: ByteArray, expected: ByteArray): Boolean {
|
|
55
|
+
// VULNERABLE: contentEquals() may early-exit on mismatch
|
|
56
|
+
return provided.contentEquals(expected)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Vulnerable string comparison using equals().
|
|
61
|
+
* String.equals() has early-exit behavior.
|
|
62
|
+
*/
|
|
63
|
+
fun vulnerableStringCompare(provided: String, expected: String): Boolean {
|
|
64
|
+
// VULNERABLE: String == comparison may early-exit
|
|
65
|
+
return provided == expected
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Vulnerable square root calculation.
|
|
70
|
+
* sqrt() has variable latency based on operand values.
|
|
71
|
+
*/
|
|
72
|
+
fun vulnerableSqrt(value: Double): Double {
|
|
73
|
+
// VULNERABLE: sqrt has variable latency
|
|
74
|
+
return sqrt(value)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Vulnerable power calculation.
|
|
79
|
+
* pow() has variable latency based on operand values.
|
|
80
|
+
*/
|
|
81
|
+
fun vulnerablePow(base: Double, exponent: Double): Double {
|
|
82
|
+
// VULNERABLE: pow has variable latency
|
|
83
|
+
return base.pow(exponent)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Vulnerable random number generation.
|
|
88
|
+
* kotlin.random.Random is predictable and not cryptographically secure.
|
|
89
|
+
*/
|
|
90
|
+
fun vulnerableRandomInt(bound: Int): Int {
|
|
91
|
+
// VULNERABLE: kotlin.random.Random is predictable
|
|
92
|
+
return Random.nextInt(bound)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Vulnerable random using Random.Default singleton.
|
|
97
|
+
*/
|
|
98
|
+
fun vulnerableRandomDefault(): Int {
|
|
99
|
+
// VULNERABLE: Random.Default is predictable
|
|
100
|
+
return Random.Default.nextInt()
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Vulnerable decompose function similar to ML-DSA.
|
|
105
|
+
* Demonstrates the KyberSlash-style vulnerability.
|
|
106
|
+
*/
|
|
107
|
+
fun vulnerableDecompose(r: Int, gamma2: Int): Pair<Int, Int> {
|
|
108
|
+
// VULNERABLE: Division has variable-time execution
|
|
109
|
+
var r1 = (r + 127) / (2 * gamma2)
|
|
110
|
+
|
|
111
|
+
// VULNERABLE: Modulo has variable-time execution
|
|
112
|
+
var r0 = r % (2 * gamma2)
|
|
113
|
+
|
|
114
|
+
// Centering
|
|
115
|
+
if (r0 > gamma2) {
|
|
116
|
+
r0 -= 2 * gamma2
|
|
117
|
+
r1 += 1
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return Pair(r1, r0)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Vulnerable table lookup using secret as index.
|
|
125
|
+
* This leaks timing through cache behavior.
|
|
126
|
+
*/
|
|
127
|
+
fun vulnerableTableLookup(secretIndex: Int, table: IntArray): Int {
|
|
128
|
+
// VULNERABLE: Array access indexed by secret leaks cache timing
|
|
129
|
+
return table[secretIndex]
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Vulnerable when expression on secret value.
|
|
134
|
+
* Switch/when statements may leak timing based on case.
|
|
135
|
+
*/
|
|
136
|
+
fun vulnerableWhenExpression(secretValue: Int): String {
|
|
137
|
+
// VULNERABLE: when compiles to tableswitch/lookupswitch
|
|
138
|
+
return when (secretValue) {
|
|
139
|
+
0 -> "zero"
|
|
140
|
+
1 -> "one"
|
|
141
|
+
2 -> "two"
|
|
142
|
+
else -> "other"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Test harness to prevent dead code elimination.
|
|
148
|
+
*/
|
|
149
|
+
fun main() {
|
|
150
|
+
println("Running vulnerable operations for testing...")
|
|
151
|
+
|
|
152
|
+
val result1 = vulnerableModReduce(12345, 97)
|
|
153
|
+
println("Mod reduce: $result1")
|
|
154
|
+
|
|
155
|
+
val result2 = vulnerableLongDivide(1234567890L, 12345L)
|
|
156
|
+
println("Long divide: $result2")
|
|
157
|
+
|
|
158
|
+
val result3 = vulnerableFloatDivide(10.0, 3.0)
|
|
159
|
+
println("Float divide: $result3")
|
|
160
|
+
|
|
161
|
+
val a = byteArrayOf(1, 2, 3)
|
|
162
|
+
val b = byteArrayOf(1, 2, 3)
|
|
163
|
+
val result4 = vulnerableTokenCompare(a, b)
|
|
164
|
+
println("Token compare: $result4")
|
|
165
|
+
|
|
166
|
+
val result5 = vulnerableSqrt(144.0)
|
|
167
|
+
println("Sqrt: $result5")
|
|
168
|
+
|
|
169
|
+
val result6 = vulnerableRandomInt(100)
|
|
170
|
+
println("Random: $result6")
|
|
171
|
+
|
|
172
|
+
val (r1, r0) = vulnerableDecompose(1000, 261888)
|
|
173
|
+
println("Decompose: r1=$r1, r0=$r0")
|
|
174
|
+
|
|
175
|
+
val table = intArrayOf(1, 2, 3, 4, 5, 6, 7, 8)
|
|
176
|
+
val result8 = vulnerableTableLookup(5, table)
|
|
177
|
+
println("Table lookup: $result8")
|
|
178
|
+
|
|
179
|
+
val result9 = vulnerableWhenExpression(1)
|
|
180
|
+
println("When result: $result9")
|
|
181
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
/**
|
|
3
|
+
* Vulnerable PHP code sample for constant-time analysis testing.
|
|
4
|
+
*
|
|
5
|
+
* This file demonstrates common timing side-channel vulnerabilities in PHP:
|
|
6
|
+
* - Variable-time division operations
|
|
7
|
+
* - Timing-unsafe string comparisons
|
|
8
|
+
* - Cache-timing side-channels via table lookups
|
|
9
|
+
* - Predictable randomness
|
|
10
|
+
*
|
|
11
|
+
* DO NOT USE THIS CODE IN PRODUCTION - it is intentionally vulnerable.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Vulnerable modular reduction using division.
|
|
16
|
+
* The division and modulo operations have data-dependent timing.
|
|
17
|
+
*/
|
|
18
|
+
function vulnerable_mod_reduce(int $value, int $modulus): int
|
|
19
|
+
{
|
|
20
|
+
// VULNERABLE: Division has data-dependent timing
|
|
21
|
+
$quotient = intdiv($value, $modulus);
|
|
22
|
+
// VULNERABLE: Modulo has data-dependent timing
|
|
23
|
+
$remainder = $value % $modulus;
|
|
24
|
+
return $remainder;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Vulnerable token comparison using early-exit comparison.
|
|
29
|
+
* This leaks timing information about how many characters match.
|
|
30
|
+
*/
|
|
31
|
+
function vulnerable_token_compare(string $provided, string $expected): bool
|
|
32
|
+
{
|
|
33
|
+
// VULNERABLE: === on strings may early-exit
|
|
34
|
+
return $provided === $expected;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Vulnerable token comparison using strcmp.
|
|
39
|
+
* strcmp() has variable-time execution.
|
|
40
|
+
*/
|
|
41
|
+
function vulnerable_strcmp_compare(string $provided, string $expected): bool
|
|
42
|
+
{
|
|
43
|
+
// VULNERABLE: strcmp has variable-time execution
|
|
44
|
+
return strcmp($provided, $expected) === 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Vulnerable hex encoding using chr().
|
|
49
|
+
* chr() uses table lookup indexed by secret data.
|
|
50
|
+
*/
|
|
51
|
+
function vulnerable_byte_to_hex(int $byte): string
|
|
52
|
+
{
|
|
53
|
+
$hex_chars = '0123456789abcdef';
|
|
54
|
+
// VULNERABLE: chr() has cache-timing side-channel
|
|
55
|
+
$high = chr(ord($hex_chars[$byte >> 4]));
|
|
56
|
+
$low = chr(ord($hex_chars[$byte & 0x0f]));
|
|
57
|
+
return $high . $low;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Vulnerable encoding using bin2hex.
|
|
62
|
+
* bin2hex() uses table lookups on secret data.
|
|
63
|
+
*/
|
|
64
|
+
function vulnerable_encode_secret(string $secret): string
|
|
65
|
+
{
|
|
66
|
+
// VULNERABLE: bin2hex uses table lookups
|
|
67
|
+
return bin2hex($secret);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Vulnerable base64 encoding.
|
|
72
|
+
* base64_encode() uses table lookups on secret data.
|
|
73
|
+
*/
|
|
74
|
+
function vulnerable_base64_secret(string $secret): string
|
|
75
|
+
{
|
|
76
|
+
// VULNERABLE: base64_encode uses table lookups
|
|
77
|
+
return base64_encode($secret);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Vulnerable random token generation using mt_rand.
|
|
82
|
+
* mt_rand() is predictable and not cryptographically secure.
|
|
83
|
+
*/
|
|
84
|
+
function vulnerable_generate_token(int $length): string
|
|
85
|
+
{
|
|
86
|
+
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
|
87
|
+
$token = '';
|
|
88
|
+
for ($i = 0; $i < $length; $i++) {
|
|
89
|
+
// VULNERABLE: mt_rand is predictable
|
|
90
|
+
$token .= $chars[mt_rand(0, strlen($chars) - 1)];
|
|
91
|
+
}
|
|
92
|
+
return $token;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Vulnerable unique ID generation using uniqid.
|
|
97
|
+
* uniqid() is predictable.
|
|
98
|
+
*/
|
|
99
|
+
function vulnerable_generate_id(): string
|
|
100
|
+
{
|
|
101
|
+
// VULNERABLE: uniqid is predictable
|
|
102
|
+
return uniqid('prefix_', true);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Vulnerable array shuffle using shuffle().
|
|
107
|
+
* shuffle() uses mt_rand internally.
|
|
108
|
+
*/
|
|
109
|
+
function vulnerable_shuffle_array(array $items): array
|
|
110
|
+
{
|
|
111
|
+
// VULNERABLE: shuffle uses mt_rand internally
|
|
112
|
+
shuffle($items);
|
|
113
|
+
return $items;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Test harness to prevent dead code elimination
|
|
117
|
+
function run_tests(): void
|
|
118
|
+
{
|
|
119
|
+
echo "Running vulnerable operations for testing...\n";
|
|
120
|
+
|
|
121
|
+
$result1 = vulnerable_mod_reduce(12345, 97);
|
|
122
|
+
echo "Mod reduce: $result1\n";
|
|
123
|
+
|
|
124
|
+
$result2 = vulnerable_token_compare("secret123", "secret123");
|
|
125
|
+
echo "Token compare: " . ($result2 ? "true" : "false") . "\n";
|
|
126
|
+
|
|
127
|
+
$result3 = vulnerable_byte_to_hex(0xAB);
|
|
128
|
+
echo "Byte to hex: $result3\n";
|
|
129
|
+
|
|
130
|
+
$result4 = vulnerable_encode_secret("secret");
|
|
131
|
+
echo "Encoded: $result4\n";
|
|
132
|
+
|
|
133
|
+
$result5 = vulnerable_generate_token(16);
|
|
134
|
+
echo "Token: $result5\n";
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Only run if executed directly
|
|
138
|
+
if (basename(__FILE__) === basename($_SERVER['SCRIPT_FILENAME'] ?? '')) {
|
|
139
|
+
run_tests();
|
|
140
|
+
}
|