← Back to scan
File as GitHub Issue repo: PostHog/posthog-js

Push this scan report to PostHog/posthog-js

Click the green button below to open GitHub’s new-issue form, pre-filled with the report title, summary table, top findings, and an embedded score-card image. No authentication needed — you review on GitHub before submitting. Repobility is credited as the scanner.

Embedded score card image

This image will render at the top of the issue body. Hosted on Repobility, refreshes automatically after re-scans.

Repobility score card

Issue title

XSS Risk

Curate findings to include

Pick exactly which findings appear in the issue body. By default the top 5 are included. Uncheck noise, check what matters.

Top 5 (default)
Severity Rule Title File:line
CRIT JRN001 Token handoff appears to use a callback URL or fragment packages/browser/src/posthog-surveys.ts:217
CRIT JRN001 Token handoff appears to use a callback URL or fragment packages/browser/src/posthog-featurefla…:1154
HIGH SEC100 [SEC100] CORS permissive Access-Control-Allow-Origin: *: Permissive CORS policy (`*` orig… packages/rrweb/rrweb/scripts/utils.js:41
HIGH MINED004 [MINED004] Weak Crypto: MD5/SHA1/DES/RC4 used for security context (not just checksums). packages/react-native/src/tooling/utils…:52
HIGH SEC006 [SEC006] XSS Risk: Direct HTML injection without sanitization. playground/vite/src/main.ts:6
HIGH SEC103 [SEC103] LDAP injection — non-constant search filter: User input concatenated into an LDA… packages/browser/src/utils/event-utils.…:141
HIGH SEC040 [SEC040] innerHTML XSS — template literal with server-supplied data: Setting .innerHTML w… playground/vite/src/counter.ts:5
HIGH SEC040 [SEC040] innerHTML XSS — template literal with server-supplied data: Setting .innerHTML w… packages/react-native/src/autocapture.t…:50
HIGH SEC040 [SEC040] innerHTML XSS — template literal with server-supplied data: Setting .innerHTML w… packages/browser/src/extensions/surveys…:11
HIGH SEC083 [SEC083] JS: new RegExp() with non-literal: new RegExp(<variable>) — variable input can c… packages/browser/src/utils/regex-utils.…:3
HIGH SEC083 [SEC083] JS: new RegExp() with non-literal: new RegExp(<variable>) — variable input can c… packages/browser/src/utils/elements-cha…:35
HIGH SEC083 [SEC083] JS: new RegExp() with non-literal: new RegExp(<variable>) — variable input can c… packages/browser/src/extensions/surveys…:182
HIGH SEC085 [SEC085] JS: child_process.exec with non-literal: child_process.exec with user-derived in… packages/core/src/error-tracking/parser…:26
HIGH SEC085 [SEC085] JS: child_process.exec with non-literal: child_process.exec with user-derived in… packages/browser/src/utils/elements-cha…:12
HIGH SEC085 [SEC085] JS: child_process.exec with non-literal: child_process.exec with user-derived in… packages/ai/src/sanitization/base64_rec…:8
HIGH SEC128 [SEC128] Async function without await — fire-and-forget Promise (AI mistake): Async call … packages/next/src/middleware/postHogMid…:162
HIGH SEC128 [SEC128] Async function without await — fire-and-forget Promise (AI mistake): Async call … packages/core/src/error-tracking/utils.…:20
HIGH SEC128 [SEC128] Async function without await — fire-and-forget Promise (AI mistake): Async call … packages/ai/src/prompts.ts:256
HIGH SEC029 [SEC029] Server-Side Request Forgery (SSRF) — outbound HTTP from user input: Outbound HTT… packages/ai/src/otel/processor.ts:89
HIGH SEC029 [SEC029] Server-Side Request Forgery (SSRF) — outbound HTTP from user input: Outbound HTT… packages/ai/src/otel/exporter.ts:79
HIGH SEC029 [SEC029] Server-Side Request Forgery (SSRF) — outbound HTTP from user input: Outbound HTT… examples/example-expo-53/ios/exampleexp…:58
HIGH MINED027 [MINED027] React State Array Mutation: state.X.push/splice/sort followed by setState — Re… scripts/docs/utils.js:141
HIGH MINED027 [MINED027] React State Array Mutation: state.X.push/splice/sort followed by setState — Re… compliance/node/adapter.js:68
HIGH SEC135 [SEC135] Auth/permission check missing on AI-generated endpoint: Mutating HTTP endpoint g… compliance/node/adapter.js:32
HIGH DKR014 Dockerfile copies the entire context without .dockerignore packages/browser/playground/react-route…:12
HIGH DKR014 Dockerfile copies the entire context without .dockerignore packages/browser/playground/react-route…:2
HIGH MINED134 [MINED134] Binary file `examples/example-expo-53/android/gradle/wrapper/gradle-wrapper.ja… examples/example-expo-53/android/gradle…:1
HIGH MINED122 [MINED122] package.json dep `posthog-node` pulled from URL/Git: `dependencies.posthog-nod… examples/example-convex/package.json:1
HIGH MINED122 [MINED122] package.json dep `@posthog/convex` pulled from URL/Git: `dependencies.@posthog… examples/example-convex/package.json:1
HIGH MINED122 [MINED122] package.json dep `@posthog/ai` pulled from URL/Git: `dependencies.@posthog/ai`… examples/example-convex/package.json:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/error-track…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/error-track…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/error-track…:1
HIGH MINED118 [MINED118] Dockerfile FROM `node:20-alpine` not pinned by digest: `FROM node:20-alpine` r… packages/browser/playground/react-route…:16
HIGH MINED118 [MINED118] Dockerfile FROM `node:20-alpine` not pinned by digest: `FROM node:20-alpine` r… packages/browser/playground/react-route…:10
HIGH MINED118 [MINED118] Dockerfile FROM `node:20-alpine` not pinned by digest: `FROM node:20-alpine` r… packages/browser/playground/react-route…:5
HIGH MINED118 [MINED118] Dockerfile FROM `node:20-alpine` not pinned by digest: `FROM node:20-alpine` r… packages/browser/playground/react-route…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/react-route…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/nuxtjs/pack…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/chakra-emot…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/csp-violati…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `dependencies.posthog-js` =… packages/browser/playground/redux-todo-…:1
HIGH MINED122 [MINED122] package.json dep `posthog-js` pulled from URL/Git: `devDependencies.posthog-js… packages/browser/package.json:1
HIGH MINED118 [MINED118] Dockerfile FROM `node:20-alpine` not pinned by digest: `FROM node:20-alpine` r… compliance/node/Dockerfile:1
HIGH MINED118 [MINED118] Dockerfile FROM `node:20-alpine` not pinned by digest: `FROM node:20-alpine` r… compliance/browser/Dockerfile:1
HIGH MINED122 [MINED122] package.json dep `eslint-plugin-posthog-js` pulled from URL/Git: `devDependenc… package.json:1
HIGH JRN009 Secret-like setting is echoed into a password input value packages/browser/playground/copy-autoca…:37
HIGH MINED113 [MINED113] Express POST /flags has no auth: Express route POST /flags declared without an… packages/browser/playground/session-rec…:16
HIGH MINED113 [MINED113] Express POST /reset has no auth: Express route POST /reset declared without an… compliance/node/adapter.js:187
HIGH MINED113 [MINED113] Express POST /get_feature_flag has no auth: Express route POST /get_feature_fl… compliance/node/adapter.js:148
HIGH MINED113 [MINED113] Express POST /flush has no auth: Express route POST /flush declared without an… compliance/node/adapter.js:123
HIGH MINED113 [MINED113] Express POST /capture has no auth: Express route POST /capture declared withou… compliance/node/adapter.js:92
HIGH MINED113 [MINED113] Express POST /init has no auth: Express route POST /init declared without an a… compliance/node/adapter.js:32
HIGH MINED113 [MINED113] Express POST /reset has no auth: Express route POST /reset declared without an… compliance/browser/adapter.js:375
HIGH MINED113 [MINED113] Express POST /get_feature_flag has no auth: Express route POST /get_feature_fl… compliance/browser/adapter.js:291
HIGH MINED113 [MINED113] Express POST /flush has no auth: Express route POST /flush declared without an… compliance/browser/adapter.js:270
HIGH MINED113 [MINED113] Express POST /capture has no auth: Express route POST /capture declared withou… compliance/browser/adapter.js:241
HIGH MINED113 [MINED113] Express POST /init has no auth: Express route POST /init declared without an a… compliance/browser/adapter.js:198
MED SEC041 [SEC041] Tabnabbing — target="_blank" without rel="noopener noreferrer": <a target="_blan… playground/vite/src/main.ts:8
MED SEC136 [SEC136] AI-typical over-broad exception handler swallowing all errors: Catch-all excepti… packages/rrweb/rrweb/src/replay/canvas/…:22
MED SEC136 [SEC136] AI-typical over-broad exception handler swallowing all errors: Catch-all excepti… packages/react-native/src/native-deps.t…:150
MED ERR002 [ERR002] Empty Catch Block: Empty catch blocks hide errors. packages/react-native/src/optional/Opti…:8
MED ERR002 [ERR002] Empty Catch Block: Empty catch blocks hide errors. packages/react-native/src/native-deps.t…:216
MED ERR002 [ERR002] Empty Catch Block: Empty catch blocks hide errors. packages/core/src/utils/promise-queue.ts:10
MED SEC123 [SEC123] Production stack trace / debug output exposed: Debug mode left on in production … playground/nextjs/pages/_app.tsx:28
MED SEC123 [SEC123] Production stack trace / debug output exposed: Debug mode left on in production … packages/core/src/gzip.ts:130
MED SEC045 [SEC045] eval()/exec() on stored or user-supplied data: eval() and exec() on data — even … packages/core/src/error-tracking/parser…:26
MED SEC045 [SEC045] eval()/exec() on stored or user-supplied data: eval() and exec() on data — even … packages/browser/src/utils/elements-cha…:12
MED SEC045 [SEC045] eval()/exec() on stored or user-supplied data: eval() and exec() on data — even … packages/ai/src/sanitization/base64_rec…:8
MED SEC134 [SEC134] AI scaffold leftover — Lorem ipsum / example.com / John Doe in code: Lorem ipsum… packages/react-native/scripts/generate-…:29
MED SEC134 [SEC134] AI scaffold leftover — Lorem ipsum / example.com / John Doe in code: Lorem ipsum… packages/node/scripts/generate-docs.mjs:30
MED SEC134 [SEC134] AI scaffold leftover — Lorem ipsum / example.com / John Doe in code: Lorem ipsum… examples/example-next-app-router/app/au…:9
MED AUC001 [AUC001] No Repobility access matrix policy found: The repository uses web/API frameworks…
MED DKR017 Dockerfile installs dependencies after copying the full source tree packages/browser/playground/react-route…:4
MED DKR007 Docker build context has no .dockerignore .dockerignore
MED DKR001 Docker final stage has no non-root USER packages/browser/playground/react-route…:17
LOW SEC132 [SEC132] String concat where the language has interpolation (AI style drift): String buil… packages/node/src/extensions/sentry-int…:150
LOW SEC132 [SEC132] String concat where the language has interpolation (AI style drift): String buil… packages/core/src/utils/number-utils.ts:19
LOW SEC132 [SEC132] String concat where the language has interpolation (AI style drift): String buil… packages/browser/src/extensions/sentry-…:138
LOW AIC003 Duplicated implementation block across source files packages/rrweb/rrweb-snapshot/src/utils…:175
LOW AIC003 Duplicated implementation block across source files packages/rrweb/rrweb-snapshot/src/recor…:1
LOW AIC003 Duplicated implementation block across source files packages/rrweb/rrweb-snapshot/src/rebui…:19
LOW AIC003 Duplicated implementation block across source files packages/rrweb/rrdom/src/index.ts:45
LOW AIC003 Duplicated implementation block across source files packages/rrweb/plugins/rrweb-plugin-con…:19
LOW AIC003 Duplicated implementation block across source files packages/react-native/src/surveys/surve…:294
LOW AIC003 Duplicated implementation block across source files packages/react-native/src/surveys/surve…:209
LOW AIC003 Duplicated implementation block across source files packages/react-native/src/surveys/compo…:387
LOW AIC003 Duplicated implementation block across source files packages/plugin-utils/rslib.config.ts:1
LOW AIC003 Duplicated implementation block across source files packages/node/src/types.ts:105
LOW AIC003 Duplicated implementation block across source files packages/node/src/extensions/sentry-int…:75
LOW AIC003 Duplicated implementation block across source files packages/node/rslib.config.ts:1
LOW AIC003 Duplicated implementation block across source files packages/mcp/rslib.config.ts:1
LOW AIC003 Duplicated implementation block across source files packages/core/src/types.ts:392
LOW AIC003 Duplicated implementation block across source files packages/browser/playwright.config.ts:3
LOW AIC003 Duplicated implementation block across source files packages/browser/playground/redux-todo-…:9
LOW AIC003 Duplicated implementation block across source files packages/ai/src/openai/index.ts:71
LOW AIC003 Duplicated implementation block across source files compliance/node/adapter.js:111
LOW WEB005 robots.txt does not advertise a sitemap examples/example-web/public/robots.txt
LOW DKC010 Compose service lacks no-new-privileges hardening compliance/node/docker-compose.yml:1
LOW DKC010 Compose service lacks no-new-privileges hardening compliance/browser/docker-compose.yml:1
INFO MINED088 [MINED088] React Conditional Hook: useState/useEffect inside if/loop violates Rules of Ho… packages/react/src/context/PostHogProvi…:69
INFO MINED058 [MINED058] React Dangerously Set Html: dangerouslySetInnerHTML bypasses Reacts JSX escapi… packages/browser/src/extensions/product…:81
INFO MINED058 [MINED058] React Dangerously Set Html: dangerouslySetInnerHTML bypasses Reacts JSX escapi… packages/browser/src/extensions/product…:91
INFO MINED045 [MINED045] Ts Non Null Assertion: x! asserts not null - bypasses null checks - TypeError … packages/browser/src/extensions/excepti…:131
INFO MINED045 [MINED045] Ts Non Null Assertion: x! asserts not null - bypasses null checks - TypeError … packages/browser/src/extensions/dead-cl…:42
INFO MINED045 [MINED045] Ts Non Null Assertion: x! asserts not null - bypasses null checks - TypeError … packages/browser/src/entrypoints/tracin…:216
INFO MINED054 [MINED054] Ts As Any: Casting to any (as any) bypasses type checking entirely. packages/browser/src/entrypoints/array.…:12
INFO MINED054 [MINED054] Ts As Any: Casting to any (as any) bypasses type checking entirely. packages/browser/src/consent.ts:128
INFO MINED054 [MINED054] Ts As Any: Casting to any (as any) bypasses type checking entirely. packages/browser/playground/chakra-emot…:17
INFO MINED056 [MINED056] React Key As Index: key={index} in map() — re-renders the wrong elements on re… packages/react/src/components/PostHogCa…:107
INFO MINED056 [MINED056] React Key As Index: key={index} in map() — re-renders the wrong elements on re… packages/browser/src/extensions/product…:110
INFO MINED056 [MINED056] React Key As Index: key={index} in map() — re-renders the wrong elements on re… examples/example-next-app-router/app/ca…:47
INFO MINED052 [MINED052] Ts Any Typed: : any used as type annotation. Defeats TypeScript type safety. examples/example-node/server.ts:77
INFO MINED052 [MINED052] Ts Any Typed: : any used as type annotation. Defeats TypeScript type safety. examples/example-expo-53/app/surveys.tsx:25
INFO MINED052 [MINED052] Ts Any Typed: : any used as type annotation. Defeats TypeScript type safety. examples/example-ai-aws-bedrock/chat.ts:45
INFO MINED044 [MINED044] Js Console Log Prod: console.log left in code. Should be replaced with logger … examples/example-ai-anthropic/streaming…:44
INFO MINED044 [MINED044] Js Console Log Prod: console.log left in code. Should be replaced with logger … examples/example-ai-anthropic/chat.ts:65
INFO MINED044 [MINED044] Js Console Log Prod: console.log left in code. Should be replaced with logger … compliance/node/adapter.js:205
INFO MINED043 [MINED043] Http Not Https: Hardcoded http:// (not localhost) for endpoints that handle cr… playground/nextjs/pages/replay-examples…:25
INFO MINED043 [MINED043] Http Not Https: Hardcoded http:// (not localhost) for endpoints that handle cr… packages/core/src/utils/bot-detection.ts:21
Reset to top 5 120 findings available (after auto-suppression of test files + won't-fix)

Issue body (markdown)

## Code-quality scan: `PostHog/posthog-js`

**Score: 67/100 (A-)**  ·  120 findings  ·  scanned 2026-06-05 18:32 UTC  ·  259,435 LOC

| Severity | Count |
|---|---|
| CRITICAL | 2 |
| HIGH | 56 |
| MEDIUM | 18 |
| LOW | 24 |

📊 [Full filterable report](https://repobility.com/scan/1874ab3f-846a-4195-84e6-26fee77143c6/)  ·  ![scorecard](https://repobility.com/scan/1874ab3f-846a-4195-84e6-26fee77143c6/report.png?v=1780684355-s2)

### Top findings

1. **CRITICAL** `JRN001` — Token handoff appears to use a callback URL or fragment
   `packages/browser/src/posthog-surveys.ts:217`
2. **CRITICAL** `JRN001` — Token handoff appears to use a callback URL or fragment
   `packages/browser/src/posthog-featureflags.ts:1154`
3. **HIGH** `SEC100` — CORS permissive Access-Control-Allow-Origin: *
   `packages/rrweb/rrweb/scripts/utils.js:41` · A05:2021 Security Misconfiguration
4. **HIGH** `MINED004` — Weak Crypto
   `packages/react-native/src/tooling/utils.ts:52` · CWE-327 · ✓ Repobility
5. **HIGH** `SEC006` — XSS Risk
   `playground/vite/src/main.ts:6` · A03:2021 Injection

---

**Security note**: this issue is public. If any flagged finding is a real, exploitable vulnerability, please redirect to your `SECURITY.md` policy or open a [private security advisory](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing-information-about-vulnerabilities/privately-reporting-a-security-vulnerability) instead. We're happy to close this and re-submit privately.

---

_Filed automatically. Close this issue if not useful — we won't refile. Full report: https://repobility.com/scan/1874ab3f-846a-4195-84e6-26fee77143c6/_
Megaproject â high spam risk
Could not determine 'PostHog/posthog-js' star count (GitHub API rate-limited or unreachable). When in doubt about repo size, prefer opening a focused PR or a discussion rather than an issue.

The button opens GitHubâs new-issue page in a new tab. You will see the title + body pre-filled â review, edit if you want, then click GitHubâs "Submit new issue" button. Repobility never posts anything on your behalf.

For real security findings on big repos: use the project's SECURITY.md or private advisory flow instead of a public issue.