Commit Graph

133 Commits

Author SHA1 Message Date
Thomas Durieux 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 afd9f36cfb improve admin overview 2026-05-11 12:10:17 +03:00
tdurieux 03e18fd572 repo change + daily stat improvements 2026-05-11 12:10:17 +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
tdurieux fbbc694747 improve styling 2026-05-07 07:34:30 +03:00
tdurieux 8fc7ac5175 Add user ban/activate feature
Add admin endpoints to ban and activate users, block banned users
from all auth flows (OAuth, token login, bearer auth), and invalidate
existing sessions on next request. Includes frontend translation and
user detail page ban/activate buttons.
2026-05-07 05:41:12 +03:00
tdurieux dfa5a2e2fd Fix repo link on admin errors page to point to repo view 2026-05-06 21:38:31 +03:00
tdurieux d9104c2ec2 Update commit on branch refresh and validate commit exists on save
Refresh button now always updates the commit to the latest SHA instead
of preserving the stale one in edit mode. Both create and update routes
verify the commit still exists on GitHub before persisting.
2026-05-06 21:14:53 +03:00
tdurieux d1d6257512 fix audio url 2026-05-06 20:37:50 +03:00
tdurieux c1e18f82a9 Improve error handling 2026-05-06 17:39:43 +03:00
tdurieux dcb524c8c1 Improve error handling 2026-05-06 16:45:22 +03:00
tdurieux 873c910dd3 Improve error dashboard 2026-05-06 16:12:37 +03:00
tdurieux c2d43164d0 error logging improvement, regex fix 2026-05-06 11:16:12 +03:00
tdurieux 27d6b56da7 fix mulitple bugs 2026-05-05 12:34:03 +03:00
tdurieux f8c91ca0af multiple fixes 2026-05-05 10:32:31 +03:00
tdurieux dee406e2ea update design 2026-05-05 00:36:42 +03:00
tdurieux f0bc53f093 feat: gist & co-authors 2026-05-04 13:10:44 +02:00
tdurieux c8fc561dac fix: regex characters in terms shouldn't block submission
Entering an IP address (e.g. 192.168.1.1) or any term with regex
metacharacters made the form invalid because the "regex characters
detected" hint was wired up via $setValidity('terms', 'regex', false).
The text in the UI labels it as a warning, but the form treated it as
an error and refused to save.

Track the warning as a plain $scope flag and show it via ng-show on
that flag, so the form stays valid (#430).
2026-05-04 10:58:17 +02:00
tdurieux 59d9805276 update titles 2026-05-04 09:33:44 +02:00
tdurieux 4bc83db416 feat: per-term anonymization output via term=>replacement
A term entered as "Anonymous=>ABC" now scrubs "Anonymous" to "ABC"
instead of "XXXX-N". Lets users keep anonymized identifiers valid in
source code (no hyphen) and align tokens between paper text and repo.
Indexing for default-mask terms is unchanged: a list of
"Alpha=>AAA", "Beta" still produces XXXX-2 for Beta.

Fixes #285.
2026-05-04 09:31:31 +02:00
tdurieux db2ac5307d fix admin 2026-05-03 22:29:01 +02:00
tdurieux e18961208a fix(admin): bind token form to dotted scope to escape ng-if child scope
The Generate button silently no-op'd because ng-model="newTokenName" inside
an ng-if block wrote to a child scope, leaving $scope.newTokenName empty.
Use $scope.tokenForm.{name,plaintext} so prototypal lookup resolves to the
controller scope.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 19:40:28 +02:00
tdurieux 5793e2dbb5 fix: allow removing expired and errored repositories from dashboard
The Remove action in the dashboard dropdown was gated on
status == 'ready', so expired repos showed no way to be removed and
stuck on the front page. The backend DELETE route already accepts any
non-'removed' status, so widen the ng-show to include 'expired' and
'error'.

Fixes #463.
2026-05-03 19:29:08 +02:00
tdurieux 57f2cf1b11 update faq 2026-05-03 18:29:20 +02:00
tdurieux a5f66d6844 multiple fixes 2026-05-03 15:30:54 +02:00
tdurieux 66510f486d update design 2026-04-24 15:12:56 +02:00
tdurieux 88f826aab4 update design 2026-04-24 14:55:18 +02:00
Thomas Durieux 3f32ec5ca1 claude/fix-page-width-layout-SY7c5 (#679)
* Fix horizontal overflow causing page content to be cut off on mobile

- Add overflow-x: hidden to html/body and ng-view to prevent horizontal
  scrolling across all pages
- Restore .container.page mobile padding to 15px to match Bootstrap .row
  negative margins (-15px), which previously caused 5px overflow per side
- Add max-width: 100% constraints to prevent content from exceeding viewport

https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi

* Fix Ko-fi widget overlapping hamburger menu and simplify desktop layout

- Move Ko-fi "Support me" button from top-right (where it hid the navbar
  hamburger) to bottom-right corner
- Remove card styling (border, background, border-radius) from dashboard
  quota section for a flatter, cleaner look
- Remove fixed max-width: 960px from dashboard-page so it uses Bootstrap's
  standard container widths, consistent with other pages like admin

https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi

* Redesign anonymize page: centered landing, reorganized form layout

- No URL state: centered input in the middle of the page for a clean
  initial experience
- URL provided state: preview on the left, form settings on the right
  in a fixed-width sidebar panel (380px on desktop)
- Reorganized form sections into logical groups:
  Source (branch/commit) → Identity (ID/conference) → Anonymization
  (terms) → Display (checkboxes, no longer hidden in accordion) →
  Expiration
- Removed card/accordion wrappers for a flatter, more scannable form
- Mobile: form stacks below preview with sticky submit bar

https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi

* Reduce navbar height on desktop

- Reduce navbar padding from default .5rem to 4px vertical
- Shrink nav icons from 30px/40px to 20px/28px
- Reduce nav-link font size to 0.9rem with tighter padding
- Shrink navbar-brand font size to 1rem

https://claude.ai/code/session_01L2xhJCKkjghMDBuwXpSHzi

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-04-15 11:13:05 +02:00
Thomas Durieux 12d72bdc1a Update FAQ with comprehensive content and improved design (#678) 2026-04-15 10:16:05 +02:00
Thomas Durieux 261eaa8d79 Polish website UX: unify dashboards, clean up layout, modernize styling (#668) 2026-04-15 09:30:19 +02:00
Thomas Durieux 1d97c76e7e Improve mobile layout and redesign admin interface (#665) 2026-04-15 06:04:43 +02:00
Thomas Durieux 0c0cfe2c86 Update faq.htm 2025-01-30 08:36:37 -08:00
tdurieux 3a00a27153 feat: improve support for binary & audio files 2024-04-28 10:01:40 +01:00
tdurieux a86e050f8b fix: handle empty repository 2024-04-26 13:48:32 +01:00
tdurieux 710f7328e7 feat: flatten file tree for better performance 2024-04-26 10:32:09 +01:00
Joel Coffman ccdc95e4a8 doc(#269) Document the lack of support for Jekyll
Compatibility with GitHub Pages is limited: Jekyll (and other static
site generators) are not supported. This change documents this
limitation on the home page and FAQs.

Although Markdown files are converted to HTML and thus accessible when
anonymized GitHub Pages is enabled for the repository, the Markdown to
HTML conversion includes only the content -- i.e., there is no special
formatting (as would be available when using Jekyll).

For anyone who wants to use Jekyll, a potential workaround is to build
the site locally and commit the generated site to the repository.

Closes #269

Co-authored-by: Joel Coffman <joel.coffman@acm.org>
2024-04-16 08:26:44 +01:00
tdurieux a612b7a8b7 fix: fix queue admin 2024-04-12 10:02:23 +01:00
tdurieux 11a6c06d11 feat: add donation button on status page 2024-04-05 12:25:20 +01:00
tdurieux 27c54b0182 feat: add link to website if enabled 2024-04-05 12:10:07 +01:00
tdurieux f5d45394bf feat: add sha to file path to avoid caching 2024-04-04 15:56:38 +01:00
tdurieux 42c3a58a46 feat: add edit button on repo view 2024-04-03 19:11:10 +01:00
tdurieux 1d4bab7866 fix: fix webview & improve download progress 2024-04-03 18:25:33 +01:00
tdurieux a34ff741ab fix: fix profil url 2024-04-01 09:20:20 +01:00
tdurieux 42b885d5a1 fix(#234): fix FAQ related to supported file types 2023-08-28 15:12:26 +02:00
tdurieux 7e2c490e4b feat(#200): save the commit date of the anonymized commit 2023-04-25 23:40:12 +02:00
tdurieux 4293fa01b2 feat: add media player in content view 2023-04-20 23:30:26 +02:00
tdurieux e94a5f164a disable download mode for the moment 2023-04-05 12:12:57 +02:00
tdurieux f1fe8eff14 feat(#171): supports display raw content 2023-03-29 13:05:13 +02:00
tdurieux c59e202124 feat: list gh repos in user admin 2023-02-22 11:05:37 +01:00