Skip to content

[P3] Sécurité — audit auth/RLS/XSS/CSRF (interne) #100

Open

Description

@SebastienGosa

Passe de durcissement sécurité : auth, RLS, XSS, CSRF.

Suivi interne, pas d'appel à contribution publique et aucune prime rattachée à ce ticket. Les PR externes non sollicitées qui « claim » ce scope ne seront pas récompensées.

Premier correctif RLS (exposition users/donations via la clé anon) : voir #196.

Activity

  1. legalverb commented on May 11, 2026

    @legalverb

    Submitted PR #188 for the security/RLS bounty scope: #188

    Summary:

    • Direct users table reads were effectively public because the RLS SELECT policy included OR true, while the table contains email, reader preferences, location, reading stats, supporter flags, timestamps, and other account metadata.
    • The PR changes direct users reads to owner-only and adds a public_user_profiles view for safe public profile rendering.
    • It also splits public read policies from owner-only write/delete policies for reading lists and annotations so public rows are not eligible for mutation if grants are present.

    Validation notes are in the PR. I kept the change scoped to database/schema.sql.

  2. optimystical commented on May 11, 2026

    @optimystical

    Submitted PR #190 for the RLS bounty scope: #190

    Summary:

    • Enables RLS on analytics/tracking/audit tables: search_queries, affiliate_clicks, and system_jobs.
    • These tables may contain user-linked search text, IP/user-agent tracking metadata, conversion/order identifiers, worker parameters, and job errors.
    • No direct anon/authenticated policies are added, so server routes, cron jobs, and workers should use service_role for these internal tables.

    Validation: git diff --check.

  3. zaixincheng174-ai commented on May 12, 2026

    @zaixincheng174-ai

    Submitted PR #191 for the RLS/security bounty scope: #191

    Summary:

    • collections contains curator-owned draft fields and organization-scoped B2B metadata (curator_user_id, is_published, organization_id), but RLS was not enabled.
    • collection_books can expose the contents and notes of those collections.
    • The PR enables RLS for both tables, limits direct public reads to published public-catalog collections, and gates writes through curator ownership.

    Validation: git diff --check; runtime schema apply not run locally because this environment has no docker or psql.

    /claim #100

  4. zaixincheng174-ai commented on May 12, 2026

    @zaixincheng174-ai

    Submitted a second non-overlapping PR for the RLS/security bounty scope: #192

    Summary:

    • authors.organization_id and books.organization_id are documented for future B2B tenant rows (NULL = public catalog), but the catalog tables and public catalog view did not enforce that boundary.
    • The PR enables RLS on the catalog tables and limits direct client reads to public-catalog books/authors and their derived translations/files/ISBN/category links.
    • It also makes the catalog views security-invoker and filters the catalog dashboard to public-catalog rows so tenant-scoped rows are not exposed through views.

    Validation: git diff --check; runtime schema apply not run locally because this environment has no docker or psql.

    /claim #100

  5. zaixincheng174-ai commented on May 12, 2026

    @zaixincheng174-ai

    Submitted a third non-overlapping PR for the RLS/security bounty scope: #193

    Summary:

    • affiliate_retailers contains partner tags, commission rates, inactive routing config, and operator notes, but direct public API access was not guarded by RLS.
    • The PR enables RLS for affiliate_retailers and intentionally adds no anon/auth policy, keeping direct table access closed while trusted server/service-role code can still manage affiliate URL generation.
    • It also marks v_affiliate_performance as security_invoker so the revenue/performance dashboard view respects caller RLS instead of bypassing table protections by default.

    Validation: git diff --check; pnpm --filter @librarfree/db typecheck could not run because this checkout has no node_modules/tsc; runtime schema apply not run locally because this environment has no psql or docker.

    /claim #100

  6. zaixincheng174-ai commented on May 12, 2026

    @zaixincheng174-ai

    Submitted another non-overlapping hardening PR for the security bounty scope: #194

    Summary:

    Validation: git diff --check; pnpm --filter @librarfree/db typecheck could not run because this checkout has no node_modules/tsc; runtime schema apply not run locally because this environment has no psql or docker.

    /claim #100

  7. zaixincheng174-ai commented on May 12, 2026

    @zaixincheng174-ai

    Submitted another non-overlapping RLS hardening PR for the security bounty scope: #195

    Summary:

    • donations allowed direct SELECT for every anonymous = FALSE row, exposing row-level donation data through the raw table.
    • Those rows include Stripe payment/subscription identifiers, linked user ids, donor messages/display names, campaign metadata, amounts, and timestamps.
    • The PR makes direct donation table reads owner-only and leaves public transparency to aggregate/safe views such as v_transparency_monthly.

    Validation: git diff --check; pnpm --filter @librarfree/db typecheck could not run because this checkout has no node_modules/tsc; runtime schema apply not run locally because this environment has no psql or docker.

    /claim #100

  8. zaixincheng174-ai commented on May 13, 2026

    @zaixincheng174-ai

    Payout/channel clarification before I do additional security-bounty work here:

    I have submitted non-overlapping hardening PRs #191, #192, #193, #194, and #195 under this issue scope. The issue says rewards are €50-500 and references “Huntr ou GitHub Security,” but I do not see a specific payout/reporting channel in the issue text.

    If any of these PRs are accepted, should payout coordination happen directly in this GitHub issue/PR thread, through GitHub Security/Huntr, or another maintainer-preferred channel? I will hold off on further slices until the payment path is clear.

  9. changed the title [-][P3] Bug bounty — Huntr ou GitHub Security[/-] [+][P3] Sécurité — audit auth/RLS/XSS/CSRF (interne)[/+] on Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    phase-3type:infra

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions