• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

marscoin / martianrepublic / 23750714281

30 Mar 2026 02:42PM UTC coverage: 8.401% (-0.07%) from 8.467%
23750714281

push

github

Martian Congress
security: Sprint 1 — comprehensive security hardening (S1–S14)

S1:  Command injection — replaced shell_exec with Process facade
     in BlockDisplay, BlockIntervalSparkline, LegislationRepo
S2:  XSS — removed addslashes(), use json_encode for JS contexts,
     strip_tags on markdown, escaped feed display messages
S3:  Input validation — added FormRequest classes for Congress
     amendments, tier challenges, and ballot key storage
S4:  Ballot encryption — encrypted_key/encryption_iv now use
     Laravel's encrypted cast (encrypted at rest with APP_KEY)
S6:  Rate limiting — throttle on AI chat (20/m), forum posts
     (5-10/m), contact form (3/m)
S7:  2FA brute-force — 5 failed attempts triggers 15min lockout
S8:  Token expiry — Sanctum tokens expire after 24 hours
S10: Log level — production changed from debug to warning
S13: HSTS preload — added preload directive
S14: CI hardened — composer audit now fails build on vulnerabilities

79 tests passing, 0 PHPStan errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

1 of 75 new or added lines in 9 files covered. (1.33%)

9 existing lines in 4 files now uncovered.

445 of 5297 relevant lines covered (8.4%)

1.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/Http/Requests/ChallengeTierRequest.php
1
<?php
2

3
namespace App\Http\Requests;
4

5
use Illuminate\Foundation\Http\FormRequest;
6

7
class ChallengeTierRequest extends FormRequest
8
{
9
    /**
10
     * Determine if the user is authorized to make this request.
11
     */
NEW
12
    public function authorize(): bool
×
13
    {
NEW
14
        return auth()->check();
×
15
    }
16

17
    /**
18
     * Get the validation rules that apply to the request.
19
     */
NEW
20
    public function rules(): array
×
21
    {
NEW
22
        return [
×
NEW
23
            'proposalId'   => 'required|integer',
×
NEW
24
            'proposedTier' => 'required|in:signal,operational,legislative,constitutional',
×
NEW
25
            'reason'       => 'required|string|max:5000',
×
NEW
26
        ];
×
27
    }
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc