Hub rules-java

rules-java

v3 public Verified

Java

Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. These rules govern Java development, JVM tuning, and enterprise application patterns for AI agents.

@sigmashakeinc 2 pulls 10 rules published Apr 8, 2026 synced Nov 22, 2026 sigmashakeinc/rules/rulesets/rules-java →
Severity
8 error 2 warn 0 info
demo.cast
Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. These rules govern Java development, JVM tuning, and enterprise application patterns for AI agents.

Rules index

10 governance rules

Indexed from the repository's .rules files, grouped by technology. Expand any rule to read the raw source.

java

no-aes-ecb-mode error block

AES without an explicit mode defaults to ECB, which leaks patterns in ciphertext (identical plaintext blocks produce identical ciphertext — see the ECB penguin). Use AES/GCM/NoPadding for authenticated encryption or AES/CBC/PKCS5Padding with a random IV.

Rule source requires an active Pro or Enterprise subscription.
no-exception-swallow warning log

Empty catch block silently swallows exceptions. At minimum, log the exception. Swallowed exceptions make debugging production issues nearly impossible.

Rule source requires an active Pro or Enterprise subscription.
no-hardcoded-secrets-java error block

Hardcoded credential in Java source — exposed in version control and build artifacts. Store secrets in environment variables, a vault, or encrypted configuration (e.g., AWS Secrets Manager, HashiCorp Vault, Spring Cloud Config encrypted properties).

Rule source requires an active Pro or Enterprise subscription.
no-java-deserialize error block

Java deserialization of untrusted data is a critical RCE vulnerability (OWASP A08). Use JSON, Protobuf, or Apache Commons Collections safe deserialization instead.

Rule source requires an active Pro or Enterprise subscription.
no-path-traversal-java error block

File path constructed from HTTP request parameters enables path traversal (CWE-22). Normalize the path with file.getCanonicalPath() and verify it starts with the intended base directory before use.

Rule source requires an active Pro or Enterprise subscription.
no-runtime-exec-concat error block

OS command built with string concatenation enables command injection (CWE-78). Use ProcessBuilder with an explicit String[] argument list and never pass user input directly to exec(). Validate and allowlist all arguments.

Rule source requires an active Pro or Enterprise subscription.
no-string-concat-sql error block

SQL query built with string concatenation enables SQL injection. Use PreparedStatement with ? placeholders: PreparedStatement ps = conn.prepareStatement('SELECT * FROM t WHERE id = ?'); ps.setInt(1, id);

Rule source requires an active Pro or Enterprise subscription.
no-system-exit warning log

System.exit() terminates the JVM abruptly, bypassing finally blocks and shutdown hooks. In library code, throw an exception instead. In web apps, let the container manage lifecycle.

Rule source requires an active Pro or Enterprise subscription.
no-weak-crypto-java error block

Weak cryptographic algorithm (MD5/SHA-1/DES/RC4) — broken against modern attacks. Use SHA-256 or SHA-3 for hashing; AES-256-GCM for symmetric encryption; RSA-2048+/EC-256+ for asymmetric. For passwords use BCrypt, PBKDF2, or Argon2 via a dedicated password-hashing library.

Rule source requires an active Pro or Enterprise subscription.
no-xxe-vulnerable-parser error block

XML parser is vulnerable to XXE (XML External Entity) injection. Disable external entities: factory.setFeature('http://apache.org/xml/features/disallow-doctype-decl', true)

Rule source requires an active Pro or Enterprise subscription.

Version metadata

Published metadata

The hash-locked record of this published ruleset. When source contents change, the maintainer resyncs and the version bumps.

Version
v3
Published
Apr 8, 2026
Source commits
0
Synced
Nov 22, 2026
Hash
4e1b386db2e604715034a300fdd4e003bdd55f632a152728f5c4c0e450ef2877
Signature
Verified (publisher key)
Tested with
claude-code@current
Plan
Starter (free)
Visibility
Public

Source history

Recent commits

Latest commits touching rulesets/rules-java/.sigmashake/rules in sigmashakeinc/rules/rulesets/rules-java. The published version only bumps when a maintainer resyncs.

No commit history available.