Skip to content

La Famille / Field notes

Routine: Implement Security Enhancement

Goal: Identify and fix one small security issue or add one security enhancement that makes the application more secure.

Task Details

  1. Identify Opportunity: Scan the codebase for a single security vulnerability or enhancement opportunity that can be fixed cleanly in under 50 lines of code. Focus on:

    • Input Validation & Sanitization: Using html.EscapeString for XSS prevention when injecting data into HTML, validating paths with filepath.IsLocal to prevent path traversal.
    • Secrets & Config: Ensuring no hardcoded secrets or sensitive data exist in the codebase.
    • Error Handling: Ensuring error messages do not leak sensitive internal information (e.g., stack traces).
    • File Handling: Securely managing file reads/writes and user-provided inputs that affect file paths.
  2. Prioritize: Choose the highest impact issue that is feasible within the 50-line boundary. Critical vulnerabilities (path traversal, XSS, hardcoded secrets) take precedence over general enhancements.

  3. Implement: Write secure, defensive Go code.

    • Add comments explaining the specific security concern being addressed.
    • Use established Go standard library functions (html, path/filepath, crypto, etc.) or the project’s existing sanitization libraries (like bluemonday).
    • Ensure the fix handles errors securely and fails closed.
  4. Log Critical Learnings: ONLY if the task reveals a specific, non-routine insight about a vulnerability pattern specific to this codebase, log it in .jules/sentinel.md. Do not log routine generic security fixes.

    • Format: ## YYYY-MM-DD - [Title] **Vulnerability:** [What was found] **Learning:** [Why it existed] **Prevention:** [How to avoid next time]

Execution Reminders