Standards: Security Policies, Language-Specific Security Rules, and Disclosure Endpoints
Security disclosure surface and source-backed security rule sets across languages in matrix-core. Covers the central security policy, marketplace disclosure endpoint, and per-language security rules.
Overview
This section documents the project's security disclosure surface and the source-backed security rule sets that apply across languages. The repository splits policy into a central security policy, a public marketplace disclosure endpoint, a marketplace policy page, and language-specific markdown rules that reinforce secure coding and secret handling.
Security Disclosure and Policy Surface
SECURITY.md
SECURITY.md is the project's main vulnerability disclosure policy:
| Area | Policy |
|---|---|
| Supported versions | main is active; pre-1.0 fixes are provided against current main; tagged releases receive best-effort backports |
| In scope | cortex/, MCL/, bridge/, executor/, deploy/, and crypto primitives |
| Out of scope | Denial of service via legitimate workload, issues requiring existing signing keys or credentials, third-party MCP servers and dependencies, legacy code in runs/, research/, knowledge/ |
| Report channels | GitHub Security Advisory, email to security@paxeer.app, or a private channel via GitHub Discussions thread mentioning security |
| Target handling | Acknowledgement within 72 hours, triage and severity within 7 calendar days, fix planning within 14 days, coordinated disclosure by mutual agreement (typically 30-90 days) |
| Reporter expectations | Module and file line context, reproduction steps or PoC, severity, and any verified mitigation |
| Operator hardening | Replay invariant checks, atomic batch journaling, URI version pinning, closed vocabulary enforcement, rate limits, daemon auth, $env:NAME-based credential injection |
The policy explicitly asks reporters not to use public GitHub issues for security bugs.
Marketplace disclosure endpoint
marketplace/public/.well-known/security.txt:
| Field | Value |
|---|---|
Contact | mailto:security@paxeer.app |
Expires | 2027-06-30T00:00:00.000Z |
Preferred-Languages | en |
Canonical | https://market.paxeer.app/.well-known/security.txt |
Policy | https://market.paxeer.app/legal/security-policy.html |
Marketplace security policy page
marketplace/public/legal/security-policy.html is the marketplace-facing security policy landing page (marked noindex). Questions go to legal@paxeer.app.
Common Security Rules
rules/common/security.md defines the baseline security checks required before any commit:
| Category | Required behavior |
|---|---|
| Secret handling | Never hardcode secrets; use environment variables or a secret manager; validate presence at startup; rotate any exposed secrets |
| Input validation | All user inputs must be validated |
| Database safety | Use parameterized queries to prevent SQL injection |
| Browser safety | Sanitize HTML to prevent XSS |
| Request safety | Enable CSRF protection |
| Access control | Verify authentication and authorization |
| Availability controls | Apply rate limiting to all endpoints |
| Error hygiene | Error messages must not leak sensitive data |
| Response protocol | Stop immediately on security findings, route through security-reviewer, fix critical issues first, rotate exposed secrets, review codebase for similar problems |
Language-Specific Security Rules
Web
rules/web/security.md extends the shared guidance with browser-specific security. It requires a production CSP and recommends a per-request nonce for scripts instead of 'unsafe-inline'.
Go
rules/golang/security.md applies the shared security policy to **/*.go, **/go.mod, and **/go.sum.
TypeScript
rules/typescript/security.md applies the shared policy to TypeScript, JavaScript, and JSX/TSX. It forbids hardcoded API keys and shows environment-variable-based configuration using process.env.OPENAI_API_KEY with a fail-fast Error when the key is missing.
Python
rules/python/security.md applies the shared policy to **/*.py and **/*.pyi.
Java
rules/java/security.md forbids hardcoded secrets, recommends System.getenv("API_KEY"), advises using a secret manager for production, and keeps local configuration out of version control. Includes an input-validation example through createOrder where blank customer names and nonpositive amounts raise IllegalArgumentException.
Kotlin
rules/kotlin/security.md directs contributors to keep secrets in local.properties, use BuildConfig for CI-injected release values, and store runtime secrets in EncryptedSharedPreferences or Keychain. Additional requirements:
- Store tokens in secure storage rather than plain SharedPreferences.
- Implement token refresh with proper 401 and 403 handling.
- Clear auth state on logout.
- Use
BiometricPromptfor sensitive operations. - Keep ProGuard or R8 rules for serialized and reflection-based libraries.
- Validate URLs and control navigation in WebView usage.
- Disable JavaScript unless explicitly needed.
Rust
rules/rust/security.md forbids hardcoded secrets, uses std::env::var("API_KEY")-style loading, fails fast when required secrets are missing, and keeps .env files out of version control. Includes an Email::parse example with trimmed input validation, @ location check, length and domain checks, and typed validation errors. Server-side logging guidance: use tracing or log, keep detailed errors on the server, return generic messages to clients.
Swift
rules/swift/security.md requires Keychain Services for sensitive data, recommends environment variables or .xcconfig files for build-time secrets, and forbids hardcoding secrets in source.
PHP
rules/php/security.md focuses on request validation at the framework boundary, output escaping by default, prepared statements for all dynamic queries, secrets loaded from environment variables or a secret manager, and CSRF protection for state-changing requests. It also adds dependency review with composer audit and warns against abandoned packages.
Perl
rules/perl/security.md requires taint mode for CGI or web-facing scripts, sanitization of %ENV before external commands, and allowlist-based regex untainting.
C#
rules/csharp/security.md forbids hardcoded API keys, tokens, and connection strings. Developers use environment variables, user secrets for local development, and secret managers in production. Includes configuration validation that throws InvalidOperationException when a required setting is missing and parameterized SQL through QueryAsync<Order> with named parameters.
C++
rules/cpp/security.md emphasizes memory safety, buffer-overflow prevention, and undefined-behavior avoidance:
| Area | Required behavior |
|---|---|
| Memory safety | Avoid raw new and delete; use smart pointers. Avoid C-style arrays and malloc/free |
| Buffer safety | Prefer std::string, use .at() when bounds matter, avoid strcpy, strcat, sprintf |
| Undefined behavior | Initialize variables, avoid signed overflow, never dereference null or dangling pointers |
| Static analysis | Use sanitizers, clang-tidy, and cppcheck |
Dart
rules/dart/security.md forbids hardcoded secrets in Dart source, recommends --dart-define or --dart-define-from-file for compile-time config, and uses flutter_dotenv for non-secret configuration. Runtime secret storage goes to flutter_secure_storage. Mobile hardening:
- Review required permissions in
AndroidManifest.xml. - Export Android components only when necessary.
- Use
android:exported="false"when possible. - Review implicit intent filters.
- Use
FLAG_SECUREfor sensitive screens. - Keep ProGuard or R8 rules in sync with release behavior.
- Run
flutter analyzeand address warnings before release.
Chinese mirror
rules/zh/security.md restates the shared security checklist, secret management guidance, and response protocol in Chinese.
Key Files Reference
| File | Responsibility |
|---|---|
SECURITY.md | Central disclosure policy, scope, reporting channels, response timeline, operator hardening notes |
marketplace/public/.well-known/security.txt | Public security contact metadata for the marketplace |
marketplace/public/legal/security-policy.html | Marketplace security policy landing page |
rules/common/security.md | Shared security checks, secret handling, incident response protocol |
rules/web/security.md | Browser-facing CSP guidance with nonce-based scripts |
rules/golang/security.md | Go-specific extension of shared security rules |
rules/typescript/security.md | TypeScript/JavaScript secret handling guidance |
rules/python/security.md | Python-specific extension of shared security rules |
rules/java/security.md | Java-specific secret handling and input-validation guidance |
rules/kotlin/security.md | Kotlin/Android/KMP security guidance |
rules/rust/security.md | Rust-specific secret loading, validation, and logging guidance |
rules/swift/security.md | Swift-specific secure storage and build-time secret guidance |
rules/php/security.md | PHP security boundary, database, auth, and dependency guidance |
rules/perl/security.md | Perl taint-mode and input-untainting guidance |
rules/csharp/security.md | C# secret management and secure configuration guidance |
rules/cpp/security.md | C++ memory safety and static-analysis guidance |
rules/dart/security.md | Dart/Flutter secret handling and mobile hardening guidance |
rules/zh/security.md | Chinese-language version of shared security guidance |
