|
1 | | -# java-cwe-security-skills |
2 | | -Deterministic Java security remediation skills for 100+ CWE vulnerabilities. Designed for AI coding agents to detect, fix, and verify security flaws automatically. |
| 1 | +# Java CWE Security Skills 🔐 |
| 2 | + |
| 3 | +**java-cwe-security-skills** is an open-source library of **deterministic security remediation skills for Java applications**, mapped directly to the **MITRE Common Weakness Enumeration (CWE)** framework. |
| 4 | + |
| 5 | +The repository provides structured **`SKILL.md` definitions** that enable AI coding assistants and security agents to **detect, analyze, and fix vulnerabilities automatically** in Java codebases. |
| 6 | + |
| 7 | +These skills are designed for integration with modern **AI developer platforms**, including: |
| 8 | + |
| 9 | +* **Augment Code** |
| 10 | +* **skills.sh** |
| 11 | +* **Claude Code** |
| 12 | +* **Cursor AI** |
| 13 | +* **LobeHub Skills Marketplace** |
| 14 | +* **DevSecOps automation pipelines** |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +# Why This Project Exists |
| 19 | + |
| 20 | +Modern development teams rely heavily on **SAST tools** such as: |
| 21 | + |
| 22 | +* Checkmarx |
| 23 | +* SonarQube |
| 24 | +* Snyk |
| 25 | +* CodeQL |
| 26 | +* OWASP Dependency Check |
| 27 | + |
| 28 | +While these tools identify vulnerabilities, they often lack **deterministic remediation patterns**. |
| 29 | + |
| 30 | +This repository bridges that gap by providing **AI-readable remediation skills** that allow coding agents to: |
| 31 | + |
| 32 | +1. Detect vulnerable code patterns |
| 33 | +2. Map them to **specific CWE weaknesses** |
| 34 | +3. Apply **secure code transformations** |
| 35 | +4. Verify the fix through deterministic rules |
| 36 | + |
| 37 | +This enables **AI-assisted vulnerability remediation** directly inside development workflows. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +# Features |
| 42 | + |
| 43 | +✔ Deterministic remediation for **Java security vulnerabilities** |
| 44 | +✔ Coverage for **100+ Java-relevant CWE weaknesses** |
| 45 | +✔ Designed for **AI coding assistants and security agents** |
| 46 | +✔ Compatible with **Augment Code skill workflows** |
| 47 | +✔ Supports **automated vulnerability fixing in repositories** |
| 48 | +✔ Based on **MITRE CWE, OWASP, CodeQL, and secure coding best practices** |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +# Repository Structure |
| 53 | + |
| 54 | +```id="7x4ihr" |
| 55 | +java-cwe-security-skills |
| 56 | +│ |
| 57 | +├── cwe-79-xss |
| 58 | +│ └── SKILL.md |
| 59 | +│ |
| 60 | +├── cwe-89-sql-injection |
| 61 | +│ └── SKILL.md |
| 62 | +│ |
| 63 | +├── cwe-611-xxe |
| 64 | +│ └── SKILL.md |
| 65 | +│ |
| 66 | +├── cwe-918-ssrf |
| 67 | +│ └── SKILL.md |
| 68 | +│ |
| 69 | +├── cwe-502-insecure-deserialization |
| 70 | +│ └── SKILL.md |
| 71 | +│ |
| 72 | +└── ... |
| 73 | +``` |
| 74 | + |
| 75 | +Each folder represents a **single vulnerability remediation skill**. |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +# Example Skill |
| 80 | + |
| 81 | +Example: **CWE-89 SQL Injection** |
| 82 | + |
| 83 | +The skill defines: |
| 84 | + |
| 85 | +* vulnerable Java patterns |
| 86 | +* deterministic remediation logic |
| 87 | +* secure implementation examples |
| 88 | +* verification rules |
| 89 | + |
| 90 | +AI coding assistants can automatically transform vulnerable SQL queries into **secure prepared statements**. |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +# Supported Vulnerability Categories |
| 95 | + |
| 96 | +The library includes remediation skills for major vulnerability classes. |
| 97 | + |
| 98 | +### Injection |
| 99 | + |
| 100 | +* SQL Injection (CWE-89) |
| 101 | +* LDAP Injection (CWE-90) |
| 102 | +* XPath Injection (CWE-643) |
| 103 | +* Expression Language Injection (CWE-917) |
| 104 | + |
| 105 | +### Web Security |
| 106 | + |
| 107 | +* Cross-Site Scripting (CWE-79) |
| 108 | +* HTTP Response Splitting (CWE-113) |
| 109 | +* Clickjacking / Missing Security Headers (CWE-693) |
| 110 | + |
| 111 | +### Cryptography |
| 112 | + |
| 113 | +* Weak Cryptography (CWE-327) |
| 114 | +* Hardcoded Cryptographic Keys (CWE-321) |
| 115 | +* Missing Random IV (CWE-329) |
| 116 | + |
| 117 | +### Data Exposure |
| 118 | + |
| 119 | +* Information Exposure (CWE-200) |
| 120 | +* Sensitive Data in Logs (CWE-532) |
| 121 | +* Privacy Violations (CWE-359) |
| 122 | + |
| 123 | +### Deserialization |
| 124 | + |
| 125 | +* Insecure Deserialization (CWE-502) |
| 126 | + |
| 127 | +### Resource Management |
| 128 | + |
| 129 | +* Resource Exhaustion (CWE-400) |
| 130 | +* Uncontrolled Memory Allocation (CWE-789) |
| 131 | + |
| 132 | +### Input Validation |
| 133 | + |
| 134 | +* Path Traversal (CWE-22) |
| 135 | +* Regex Denial of Service (CWE-1333) |
| 136 | +* Unchecked Loop Condition (CWE-606) |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +# Using These Skills with Augment Code |
| 141 | + |
| 142 | +Augment Code can use these skills to perform **AI-assisted vulnerability remediation** during development. |
| 143 | + |
| 144 | +Typical workflow: |
| 145 | + |
| 146 | +1. Augment scans the repository for vulnerable patterns |
| 147 | +2. The vulnerability is mapped to a **CWE skill** |
| 148 | +3. The skill provides **deterministic remediation steps** |
| 149 | +4. Augment generates a **secure code transformation** |
| 150 | + |
| 151 | +Example prompt inside Augment: |
| 152 | + |
| 153 | +``` |
| 154 | +Fix SQL injection vulnerabilities in this Java service. |
| 155 | +``` |
| 156 | + |
| 157 | +The agent loads the **CWE-89 skill** and applies the secure remediation. |
| 158 | + |
| 159 | +--- |
| 160 | + |
| 161 | +# Sources |
| 162 | + |
| 163 | +Security knowledge in this repository is derived from: |
| 164 | + |
| 165 | +* MITRE CWE Database |
| 166 | +* OWASP Security Cheat Sheets |
| 167 | +* GitHub CodeQL Security Queries |
| 168 | +* Snyk Vulnerability Database |
| 169 | +* OWASP VulnerableApp |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +# Contributing |
| 174 | + |
| 175 | +Contributions are welcome. |
| 176 | + |
| 177 | +You can contribute by: |
| 178 | + |
| 179 | +* adding new CWE skills |
| 180 | +* improving remediation patterns |
| 181 | +* adding secure code examples |
| 182 | +* expanding coverage for Java frameworks |
| 183 | + |
| 184 | +--- |
| 185 | + |
| 186 | +# Vision |
| 187 | + |
| 188 | +The goal of this project is to create the **largest open-source library of AI security remediation skills for Java**. |
| 189 | + |
| 190 | +By combining **CWE knowledge + deterministic remediation patterns**, AI agents can evolve from **vulnerability detection → automatic secure code remediation**. |
0 commit comments