Commit Graph
114 Commits
Author SHA1 Message Date
Thomas Durieux c24f6d4e94 Revalidate consent sessions after request body upload 2026-10-08 16:24:40 +00:00
Thomas Durieux 7b60979c96 Protect artifact consent HTTP requests with current sessions and CSRF 2026-09-27 14:36:46 +00:00
Thomas Durieux 5485f57e02 Retain session-bound artifact owner consent under current authority 2026-09-27 14:16:57 +00:00
Thomas Durieux b776ff7e5a Add bounded authenticated review intent HTTPS consumer 2026-09-27 13:50:20 +00:00
Thomas Durieux 83e8d45192 fix: close rejected artifact service requests before body draining 2026-09-27 13:13:04 +00:00
Thomas Durieux eaa84e3af5 Add optional authenticated review-service capabilities endpoint 2026-09-27 12:51:28 +00:00
Thomas Durieux 0002e8d1a1 fix: serialize repository refreshes and recover stale downloads 2026-09-27 06:34:05 +00:00
Thomas Durieux 7ada28f9e3 fix: report repository refresh failures and reject busy updates 2026-09-27 06:09:19 +00:00
Thomas Durieux 383dad7e20 fix: prevent path traversal through hashed asset routes 2026-09-15 20:26:42 +00:00
Thomas Durieux c9c729c2c5 fix: restore public file streaming and contain ZIP failures 2026-09-14 15:06:29 +00:00
Thomas Durieux 8abdaf7119 Merge pull request #828 from tdurieux/fix/public-repository-app-access
fix: allow GitHub App access to public repositories without installation
2026-09-13 19:06:25 +02:00
Thomas Durieux 5e5cc6e0c2 fix: renew public grants and verify source identity and visibility 2026-09-13 15:05:43 +00:00
Thomas Durieux 7cdf0f5e8d fix: distinguish repository publication and settings dates 2026-09-13 08:42:54 +00:00
tdurieux 99a50cad7b feat: unify GitHub sign-in and connect OAuth for gists 2026-09-10 18:20:56 +02:00
tdurieux 3667e8e3cd fix: preserve anonymous sessions during GitHub sign-in 2026-09-10 16:15:39 +02:00
Thomas Durieux a60ad6a921 feat: add read-only GitHub App access alongside OAuth 2026-09-09 22:08:12 +02:00
tdurieux 74bd6bb779 fix: restore scripts and video playback on project pages 2026-09-08 18:01:32 +02:00
tdurieux 8ad0ec65f0 chore: upgrade Express to 5.2.1 2026-09-08 16:22:23 +02:00
Thomas Durieux 530e388e46 fix: archive ownerless repositories without assigning ownership (#800) 2026-09-08 14:03:09 +02:00
Thomas Durieux 3fb376dd53 fix: encrypt stored GitHub credentials (#797) 2026-09-08 13:04:28 +02:00
tdurieux b1cb9093bb fix: close streaming responses after upstream errors 2026-09-06 09:19:18 +02:00
tdurieux 38a09188ad fix: expire conference repositories before completing expiration 2026-09-06 09:18:42 +02:00
tdurieux 4643e9f838 fix: preserve and anonymize truncated folder warnings 2026-09-06 09:18:28 +02:00
tdurieux 9c18526d52 fix: decode and validate webview file paths 2026-09-06 09:17:56 +02:00
tdurieux 67eb83674c fix: sandbox repository webview documents 2026-09-06 09:17:52 +02:00
tdurieux 3e275311f1 fix: derive file ETags from current source content 2026-09-06 09:17:47 +02:00
tdurieux c14a548cb9 fix: enforce content policies using original file types 2026-09-06 09:17:42 +02:00
tdurieux 7210db2b61 fix: catch authentication failures in async route handlers 2026-09-06 09:17:37 +02:00
tdurieux 2af66cd1b6 fix: authorize coauthors by stable GitHub identity 2026-09-06 09:17:01 +02:00
tdurieux a401bb21d6 fix: reject OAuth linking across different GitHub identities 2026-09-06 09:16:53 +02:00
tdurieux 12c07641e0 fix: persist and recover repository removals for banned owners 2026-09-06 09:16:20 +02:00
tdurieux f5f44c2511 fix: preserve removal intent when Redis enqueue fails 2026-09-06 09:16:17 +02:00
Thomas Durieux adb0dcaec2 fix: reactivate removed repositories after edits (#784) 2026-08-20 14:33:09 +02:00
Thomas Durieux 35c3b1804b Fix repository cleanup after removal and expiration (#782) 2026-08-20 12:52:19 +02:00
Thomas Durieux 46e956a779 fix: reactivate repositories with future expiration (#781) 2026-08-20 12:29:52 +02:00
Thomas Durieux 7aa9557905 perf: cut MongoDB scans in repository workflows (#780)
* Add repository name index

* Optimize repository file counts

* Optimize MongoDB query workloads
2026-08-20 12:29:26 +02:00
tdurieux f0fdd9250b fix: improve pdf rendering and html 2026-08-06 14:35:21 -07:00
Thomas Durieux debd83c079 feat: add optional MongoDB replica deployment (#765) 2026-07-30 02:28:19 +02:00
Thomas Durieux f040557ae8 fix: preserve state across backend updates (#756) 2026-07-22 04:29:58 +02:00
Thomas Durieux beef8387ae fix: close account authorization gaps (#755) 2026-07-22 04:29:04 +02:00
Thomas DurieuxandClaude Opus 4.8 5ef10dee9e fix: dashboard menu clickability + expiration date UX (#753)
* fix: dashboard menu clickability + expiration date UX

Dashboard actions menu:
- Inactive (expired/removed) rows dimmed via their cells instead of the
  row, so `opacity` no longer creates a stacking context that trapped the
  actions dropdown beneath later rows and made its items unclickable.
- Add an "Extend 6 months" menu item for expired repos/PRs/gists.

Expiration form (anonymize):
- Fix the "After , the content will be removed." blank date: guard the
  helper text and add min/max validation feedback so an invalid pick no
  longer nulls the model into a broken sentence.
- Add a `min` (today) so past dates can no longer be selected, and
  compute min/max from local date parts (not UTC) to avoid a timezone
  off-by-one in the native picker.
- Default expiration is now 6 months (single source of truth, removing a
  latent double-offset bug); max stays at 1 year.
- Block submitting a missing/out-of-range expiration date.

Backend:
- New POST /:id/extend endpoint for repos, PRs and gists that pushes the
  expiration +6 months and re-anonymizes so expired items come back
  online, mirroring the refresh flow. Shared extendExpirationDate helper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: add frontend translation for invalid_status error code

The new /extend endpoints throw an "invalid_status" AnonymousError, which
the error-code coverage test requires to have a locale entry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 14:10:38 +02:00
Thomas DurieuxandClaude Fable 5 6a820408a1 fix: rate-limit visitors by real IP regardless of Cloudflare proxy hops (#750)
Since the night of 2026-07-16 production keyed the rate limiter on
Cloudflare edge IPs instead of visitor IPs: every visitor routed through
the same edge shared one 175-req/15min bucket, causing widespread 429s
(confirmed by probing: sequential requests alternated 200/429 across
fresh and exhausted buckets).

Root cause: 'trust proxy' used a fixed hop count (TRUST_PROXY=1), which
silently breaks whenever the proxy chain gains or loses an
X-Forwarded-For entry (e.g. a Cloudflare-side change).

- TRUST_PROXY now accepts a comma-separated subnet list; the new default
  'loopback,uniquelocal,cloudflare' expands Cloudflare's published IP
  ranges so Express skips trusted proxies no matter how many entries
  they add. Plain numbers keep the legacy hop-count behavior.
- If resolution still stops at a Cloudflare address (visitor missing
  from X-Forwarded-For entirely), the limiter key falls back to
  cf-connecting-ip — safe because request.ip can only be a Cloudflare
  address when the whole chain to it is trusted.
- CIDR matching uses Node's built-in net.BlockList (no new dependency).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 06:44:21 +02:00
Thomas Durieux 839582c657 Fix .bat anonymization, truncated-tree misses, submodule warning, account deletion (#742)
* fix: anonymize Windows batch scripts (#735)

mime-types maps .bat to application/x-msdownload, the same MIME type as
.exe/.dll, so batch scripts were classified as binary and streamed
through without any anonymization. Special-case .bat/.cmd as text before
the MIME lookup, keeping .exe/.dll binary.

* fix: recover files missing from truncated tree listings (#738)

GitHub truncates tree listings of very large repositories. Folders whose
listing was truncated are recorded in truncatedFolders, but files that
fell outside the listing never reached the database, so requesting them
returned 404 file_not_found even though they exist on GitHub — and a
force refresh could not help.

When a file lookup misses and its directory is under a truncated folder,
fetch the file metadata directly from GitHub's contents API (object
media type, so it works past the 1MB inline limit), cache it in the
database, and serve it normally.

* feat: warn when a repository uses git submodules (#737)

GitHub archives and tree listings never include submodule contents, so
submodules end up as empty folders in the anonymized repository, which
surprises users. Detect a root .gitmodules file and show a warning
banner in the explorer explaining that submodule contents are not
included.

* feat: allow users to delete their account (#741)

Add DELETE /api/user: removes all anonymized repositories, gists, and
pull requests owned by the user, best-effort revokes the GitHub OAuth
grant, and scrubs personal data (username, emails, tokens, GitHub id,
photo) from the user record. The record itself is kept with a
placeholder username so removed repoIds stay reserved and owner
references remain resolvable.

The settings page gains an Account section with a confirmed delete
button.

* fix: add missing error translations for token_expired and job_is_active

The error-code coverage test failed because both backend codes had no
frontend translation.
2026-07-02 13:35:48 +02:00
Thomas DurieuxandClaude Opus 4.8 e4ffd74068 Security hardening + gist UI fixes (#731)
* security: harden against XSS, ReDoS, path traversal, and injection

Defensive fixes across the server, storage, and viewer:

- XSS (CWE-79): sanitise rendered notebooks with DOMPurify, escape file
  names interpolated into AngularJS expressions (escapeNgString), set
  Mermaid securityLevel to 'strict', and stop urlRel2abs from returning
  javascript:/vbscript:/data:text/html URLs.
- Path traversal / zip-slip (CWE-22/23/24): validate URL-derived path
  components before they reach the storage layer (file/webview routes +
  StorageBase.assertSafePath) and sanitise zip entry names on extract for
  both the filesystem and S3 backends.
- ReDoS (CWE-1333): escape anonymization terms with catastrophic
  backtracking shapes to literals instead of compiling them as regexes.
- Secret hardening (CWE-798): require SESSION_SECRET / OAuth creds / DB
  password in production, random dev SESSION_SECRET fallback.
- Rate-limit spoofing (CWE-290): derive request.ip via trust-proxy hop
  count instead of the client-settable cf-connecting-ip header.
- NoSQL injection (CWE-943): allow only plain field paths as admin sort keys.
- Reject malformed streamer requests missing required string fields.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix(ui): make gists reachable/visible and clarify the ZIP button

- Gist & PR routes now accept a trailing slash (/gist/:id/:path*?), so the
  dashboard links (which end in "/") resolve to the gist/PR page instead of
  falling through to the 404 route (#725).
- Gist viewer picks the default tab after content loads, defaulting to
  "files" when files exist; previously the ng-init ran before the async
  load and a files-only gist rendered blank under the hidden comments tab.
- Explorer toolbar: relabel ZIP to "Full repo ZIP" with a tooltip, and add
  tooltips to Raw/Download clarifying they apply to the current file (#721).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* fix: report SAML-enforced orgs clearly instead of "token expired"

When a repo's organization enforces SAML SSO, GitHub returns a 403 whose
message differs from the OAuth-App-restriction case. That 403 fell through
to the generic handler and surfaced as "token_expired", pushing users to
re-login when the real fix is authorizing their token for the org. Detect
the "SAML enforcement" message and raise a dedicated, actionable error
instead (#379, #550).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* security: catch nested quantified groups in ReDoS guard and backslash path traversal

- hasCatastrophicBacktracking now scans across nested parens ([\s\S]*?)
  so shapes like ((a+))+ are detected; comment reframed as a heuristic
  backstop rather than a proof.
- file route path-traversal check now rejects backslash separators and a
  leading backslash, covering Windows-style "..\" payloads (CWE-22/25).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* chore(dev): track dev-proxy script, ignore .DS_Store and .claude/

scripts/dev-proxy.js is referenced by the "dev:ui" npm script but was
never committed, breaking the command on a fresh clone. Add it and
ignore local-only macOS/Claude Code files.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 13:50:55 +02:00
tdurieux 898f18919e fix rate limit 2026-05-12 20:51:08 +03:00
tdurieux 03e18fd572 repo change + daily stat improvements 2026-05-11 12:10:17 +03:00
tdurieux 3eeed23609 handle memory issues 2026-05-07 21:01:07 +03:00
tdurieux 369fd8edb2 redis cache 2026-05-07 15:55:28 +03:00
tdurieux b37a814f3a improve queue 2026-05-07 14:58:36 +03:00
tdurieux f817a29a4b loading improvements 2026-05-07 08:30:31 +03:00