Skip to content

security: add rate limiting and hash share link passwords#3011

Open
Fengsh0923 wants to merge 2122 commits intoteableio:mainfrom
Fengsh0923:security/rate-limiting-and-share-password
Open

security: add rate limiting and hash share link passwords#3011
Fengsh0923 wants to merge 2122 commits intoteableio:mainfrom
Fengsh0923:security/rate-limiting-and-share-password

Conversation

@Fengsh0923
Copy link
Copy Markdown

Summary

Two security improvements found during source code audit:

1. Rate Limiting (#3009)

  • Add @nestjs/throttler with global default (100 req/60s)
  • Stricter on auth: signin 10/min, signup 5/min, reset-password 3/min
  • Configurable via THROTTLE_TTL / THROTTLE_LIMIT env vars

2. Share Password Hashing (#3006)

  • bcrypt.compare() instead of plaintext ===
  • JWT no longer contains plaintext password, uses {shareId, nonce}
  • Backward compatible with legacy plaintext JWTs
  • Both base-share and view-share flows updated

Test Plan

  • Rate limiting triggers 429 after threshold
  • Share auth works with existing passwords
  • New JWT uses nonce (no password in payload)
  • Legacy JWT cookies still work

nichenqin and others added 30 commits December 18, 2025 17:48
* feat: enhance BaseNodeTree with ItemStatus component for app and workflow visibility

* refactor: update BaseNodeTree and QuickAction components for improved styling and layout consistency

* feat: add table update permission handling to BaseNodeTree component
* feat: template preview

* feat: add preview in template detail

* fix: remove debug code

* fix: unit test

* fix: permission.service unit test

* fix: share link view in template preview pages

* feat: more complete template preview ui

* fix: missing app actions in template

* fix: locales file conflict

* feat: template support app T1316

* feat: support jump to active node when create template

* chore: update i18n

* chore: update i18n

* perf: optimise user publish to community validation process

* fix: base export e2e fail unexpect

* fix: losing duplicate audit-log

* fix: publish dialog select active node error

* feat: unlock template recommended select

* feat: app in template preview

* fix: featured null and false filter fail

* fix: template detail scroll

* chore: constant template spaceId

* perf: create template should close schedule trigger workflow and authority

* fix: publish base ui error

* feat: template preview e2e

* perf: delete template old snapshot app when create new

* fix: import table date with computed data error

* fix: import base e2e

* fix: duplicate base do not turn on workflow and authority

---------

Co-authored-by: caoxing <caoxing9@gmail.com>
* fix: page router

* fix: update SQL migration to remove schema prefix from setting table

* feat: add app-related translations for multiple languages

* refactor: simplify e2e tests

* refactor: update e2e tests to use cached settings for improved performance
* fix:  improve query handling in TablePage component T713

* refactor: enhance BaseNodeTree component with improved rendering logic and styling adjustments

* refactor: improve view selection logic in TablePage component
* perf: template display ui

* perf: update migration for template

* perf: generate share url T1351
* feat: add template visit count T1352

* fix: add base id for base export

* fix: template ui relative
* perf: template admin panel display relative with T1374

* fix: lint error

* fix: sharedialog open without default select nodes
teableio#2325)

* fix: correct paste misalignment when using shuffled projection

* fix: form share collaborators user fields
…cope

fix: scope lookup CTE references T1361
* fix: export base table with dbtablename

relative issueid: T1388

* fix: template sql query has no permission
teableio#2327)

* feat(ui-lib): add zoom and rotate capabilities to image preview

* feat: touch device drag

* perf(ui-lib): optimize image preview performance with ResizeObserver and dimension caching
fix: cast substitute operands to text T1361
* perf: shrink template card

relative issueid: T1380

* feat: support template reorder

relative issueid: T1379
tea-artist and others added 28 commits March 23, 2026 14:03
…bleio#2836)

Synced from teableio/teable-ee@3d8d8f8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aries X <caoxing9@gmail.com>
Co-authored-by: Boris <boris2code@outlook.com>
Co-authored-by: Jun Lu <hammond@teable.io>
Co-authored-by: nichenqin <nichenqin@hotmail.com>
…ables (teableio#2845)

Synced from teableio/teable-ee@8aa82c0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aries X <caoxing9@gmail.com>
Co-authored-by: Uno <uno@teable.ai>
Co-authored-by: nichenqin <nichenqin@hotmail.com>
…ad of Node memory (teableio#2891)

Synced from teableio/teable-ee@a256ef4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aries X <caoxing9@gmail.com>
Co-authored-by: Boris <boris2code@outlook.com>
Co-authored-by: Gary Guangyu Li <gary@teable.ai>
Co-authored-by: Jun Lu <hammond@teable.io>
Co-authored-by: Uno <uno@teable.ai>
Co-authored-by: nichenqin <nichenqin@hotmail.com>
…2782) (teableio#2975)

Synced from teableio/teable-ee@6486d30

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Aries X <caoxing9@gmail.com>
Co-authored-by: Boris <boris2code@outlook.com>
Co-authored-by: Gary Guangyu Li <gary@teable.ai>
Co-authored-by: Jocky-Teable <jocky@teable.ai>
Co-authored-by: Jun Lu <hammond@teable.io>
Co-authored-by: SkyHuang <sky.huang.fe@gmail.com>
Co-authored-by: Uno <uno@teable.ai>
Co-authored-by: nichenqin <nichenqin@hotmail.com>
Two security improvements:

1. **Rate Limiting** (addresses teableio#3009):
   - Add @nestjs/throttler with global default (100 req/60s)
   - Stricter limits on auth endpoints: signin (10/min), signup (5/min),
     password reset (3/min)
   - Configurable via THROTTLE_TTL and THROTTLE_LIMIT env vars

2. **Share Link Password Hashing** (addresses teableio#3006):
   - Share passwords now validated via bcrypt.compare() instead of
     plaintext comparison
   - JWT tokens no longer contain plaintext passwords; use random nonce
   - Backward compatible: legacy plaintext JWTs still accepted during
     transition period
   - Both base-share and view-share auth flows updated

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

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ tea-artist
❌ 沈锋


沈锋 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

- Apply same bcrypt pattern to share/share-auth.service.ts (view-share)
- Hash passwords with bcrypt.genSalt(10) on write in base-share.service.ts
- Remove plaintext password from request object in share-auth-local.guard
- Add legacy token re-validation in view-share JWT strategy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.