feat: add MFA bypass and edge cases vulnerability skills with test suite#334
feat: add MFA bypass and edge cases vulnerability skills with test suite#334fresh3nough wants to merge 2 commits intousestrix:mainfrom
Conversation
- Add mfa_bypass.md: MFA bypass testing covering session fixation, code reuse, fallback abuse, enrollment flow weaknesses (CWE-308) - Add edge_cases.md: edge case testing covering caching races, partial failures, boundary conditions, eventual consistency exploitation (CWE-362) - Add tests/skills/test_skills.py: 50 test cases covering skill loading, validation, frontmatter parsing, content quality, and structural checks across all skill files
Greptile SummaryThis PR adds two well-written vulnerability skill files (
Confidence Score: 4/5
Important Files Changed
Last reviewed commit: bd242ab |
Additional Comments (3)
The comment above says "The description includes a comma-separated list of all skill names" and the replace call suggests the author intended to test the hyphenated variant (e.g. If the intent was to verify the hyphenated Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/skills/test_skills.py
Line: 596-597
Comment:
**No-op `replace` makes assertion trivially meaningless**
`skill.replace("_", "_")` replaces underscores with underscores — it is a complete no-op and produces the exact same string. The assertion is therefore identical to `assert skill in desc`, which happens to pass because `generate_skills_description()` already uses underscore-separated file stems (e.g. `mfa_bypass`, `edge_cases`).
The comment above says _"The description includes a comma-separated list of all skill names"_ and the replace call suggests the author intended to test the hyphenated variant (e.g. `mfa-bypass`) or some other transformation. As written, the test adds no value beyond the base `assert skill in desc` check and silently hides the developer's original intent.
```suggestion
assert skill in desc
```
If the intent was to verify the hyphenated `name` field from frontmatter appears in the description, note that `generate_skills_description()` uses file-stem names (underscores), not frontmatter names (hyphens), so the hyphenated form would never be found in the output. The test should simply assert the underscore form, as shown above.
How can I resolve this? If you propose a fix, please make it concise.
The test is named assert "vulnerabilities" in cats
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/skills/test_skills.py
Line: 608-611
Comment:
**Test doesn't verify what it claims — internal categories never asserted**
The test is named `test_includes_internal_categories` and the docstring explicitly states _"Should include categories that `get_available_skills` excludes"_, referring to `scan_modes` and `coordination`. However, the only assertion is:
```python
assert "vulnerabilities" in cats
```
`vulnerabilities` is present in **both** `get_available_skills()` and `_get_all_categories()`. This assertion would pass even if `_get_all_categories()` were functionally identical to `get_available_skills()`. The distinguishing behaviour of `_get_all_categories` — that it returns the internal `scan_modes` and `coordination` categories — is never exercised, so the test provides no coverage guarantee for the function's unique contract.
```suggestion
def test_includes_internal_categories(self) -> None:
cats = _get_all_categories()
# Should include categories that get_available_skills excludes
assert "vulnerabilities" in cats
assert "scan_modes" in cats, "scan_modes should be returned by _get_all_categories"
assert "coordination" in cats, "coordination should be returned by _get_all_categories"
```
How can I resolve this? If you propose a fix, please make it concise.
def test_frontmatter_has_cwe(self, frontmatter: dict[str, str]) -> None:
assert "cwe" in frontmatterPrompt To Fix With AIThis is a comment left during a code review.
Path: tests/skills/test_skills.py
Line: 674-720
Comment:
**`TestEdgeCasesSkillContent` missing CWE frontmatter assertion**
`TestMfaBypassSkillContent` includes `test_frontmatter_has_cwe` to verify the `cwe` field is present. `edge_cases.md` also declares `cwe: 362` in its frontmatter, but `TestEdgeCasesSkillContent` has no equivalent test. For consistency and to prevent regressions (e.g., accidental deletion of the `cwe` field), add the same assertion here:
```python
def test_frontmatter_has_cwe(self, frontmatter: dict[str, str]) -> None:
assert "cwe" in frontmatter
```
How can I resolve this? If you propose a fix, please make it concise. |
- Remove no-op replace('_', '_') in test_mentions_new_skills
- Add scan_modes and coordination assertions in test_includes_internal_categories
- Add test_frontmatter_has_cwe to TestEdgeCasesSkillContent for parity
Signed-off-by: fresh3nough <251773092+fresh3nough@users.noreply.github.com>
Closes #335
Summary
This PR adds two new vulnerability skill files and a comprehensive test suite to strengthen Strix's coverage in areas that were previously missing: MFA bypass techniques and edge case exploitation (caching races, partial failures, boundary conditions).
New Skills
1. MFA Bypass (
vulnerabilities/mfa_bypass.md)Covers testing for multi-factor authentication weaknesses including:
2. Edge Cases (
vulnerabilities/edge_cases.md)Covers testing for system boundary vulnerabilities including:
Test Suite
Added
tests/skills/test_skills.pywith 50 test cases across 9 test classes:TestGetAvailableSkills-- skill discovery, category filtering, sortingTestGetAllSkillNames-- aggregation across categories, new skill presenceTestValidateSkillNames-- valid/invalid/mixed input handlingTestLoadSkills-- loading, frontmatter stripping, multi-skill loading, nonexistent handlingTestGenerateSkillsDescription-- description generation and contentTestGetAllCategories-- internal category listingTestMfaBypassSkillContent-- frontmatter validation, required sections, topic coverage (session fixation, OTP reuse, fallback abuse, enrollment)TestEdgeCasesSkillContent-- frontmatter validation, required sections, topic coverage (cache poisoning, partial failures, consistency, boundaries, degradation)TestAllSkillFilesStructure-- structural validation across ALL skill .md files (frontmatter, name/description fields, non-empty content)All 50 tests pass. Ruff lint clean.
Files Changed
strix/skills/vulnerabilities/mfa_bypass.md(new)strix/skills/vulnerabilities/edge_cases.md(new)tests/skills/__init__.py(new)tests/skills/test_skills.py(new)Both skills follow the existing template style (frontmatter with name/description/category/tags/cwe, plus standardized sections: Attack Surface, High-Value Targets, Reconnaissance, Key Vulnerabilities, Bypass Techniques, Testing Methodology, Validation, False Positives, Impact, Pro Tips, Summary).