Fix unsafe URL bypass, social auth race condition, and hardcoded App Store ID#3404
Draft
Fix unsafe URL bypass, social auth race condition, and hardcoded App Store ID#3404
Conversation
… condition, AppsFlyer App Store ID in environment config Agent-Logs-Url: https://github.com/numbersprotocol/capture-cam/sessions/52acdecb-2a28-4f28-8677-40a5d875ca7a
Copilot
AI
changed the title
[WIP] Fix plaintext credential storage issue in auth service
Fix unsafe URL bypass, social auth race condition, and hardcoded App Store ID
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three medium-severity security issues: unvalidated user-controlled URLs passed to
bypassSecurityTrustUrl, a concurrent initialization race inSocialAuthService, and a hardcoded iOS App Store ID aiding attribution fraud reconnaissance.Changes
Validate URL scheme before
bypassSecurityTrustUrl(media-viewer.page.ts)The
media-viewer/:srcroute accepted any URL scheme and passed it directly tobypassSecurityTrustUrl, exploitable via deep links. Now validates against an allowlist; navigates back and logs an error on invalid input.Fix initialization race condition (
social-auth.service.ts)ensureInitialized$()used a booleaninitializingflag that caused concurrent callers to return beforeSocialLogin.initialize()completed. Replaced with a stored promise so all concurrent callers await the same in-flight initialization.Move App Store ID to environment config (
apps-flyer.service.ts)Hardcoded
appID: '1536388009'replaced withenvironment.appsFlyerAppId, defined in bothenvironment.tsandenvironment.prod.ts.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
accounts.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5300 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-45695334 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11888773020899626909,13158781441485370164,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6764469788016304644,12115922278089105067,4 --trace-process-track-uuid=3190708989122997041 node(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-45695334 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=45695334 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 /docgen npm(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5445 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-33534540 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6098245351063439170,9511589693279506805,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,16365533620647581260,9681406616313523314,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)android.clients.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5669 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-90695658 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,10590328538957487188,1677161392518640115,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,12227719290131458132,123970372596049164,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-90695658 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=90695658 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 de/node/bin/node--noprofile sh(dns block)clients2.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5300 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-45695334 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11888773020899626909,13158781441485370164,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6764469788016304644,12115922278089105067,4 --trace-process-track-uuid=3190708989122997041 node(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-45695334 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=45695334 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 /docgen npm(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5445 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-33534540 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6098245351063439170,9511589693279506805,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,16365533620647581260,9681406616313523314,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)clientservices.googleapis.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5300 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-45695334 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11888773020899626909,13158781441485370164,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6764469788016304644,12115922278089105067,4 --trace-process-track-uuid=3190708989122997041 node(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-45695334 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=45695334 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 /docgen npm(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5445 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-33534540 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6098245351063439170,9511589693279506805,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,16365533620647581260,9681406616313523314,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)download.cypress.io/home/REDACTED/work/_temp/ghcca-node/node/bin/node node index.js --exec install /doc�� get --global /sh commit.gpgsign(dns block)redirector.gvt1.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5300 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-45695334 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11888773020899626909,13158781441485370164,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6764469788016304644,12115922278089105067,4 --trace-process-track-uuid=3190708989122997041 node(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-45695334 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=45695334 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 /docgen npm(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5445 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-33534540 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6098245351063439170,9511589693279506805,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,16365533620647581260,9681406616313523314,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)safebrowsingohttpgateway.googleapis.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5300 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-45695334 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11888773020899626909,13158781441485370164,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6764469788016304644,12115922278089105067,4 --trace-process-track-uuid=3190708989122997041 node(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-45695334 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=45695334 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 /docgen npm(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5445 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-33534540 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6098245351063439170,9511589693279506805,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,16365533620647581260,9681406616313523314,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)www.google.com/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5300 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-45695334 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,11888773020899626909,13158781441485370164,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6764469788016304644,12115922278089105067,4 --trace-process-track-uuid=3190708989122997041 node(dns block)/opt/google/chrome/chrome /usr/bin/google-chrome --user-data-dir=/tmp/karma-45695334 --enable-automation --no-default-browser-check --no-first-run --disable-default-apps --disable-popup-blocking --disable-translate --disable-REDACTED-timer-throttling --disable-renderer-REDACTEDing --disable-device-discovery-notifications --no-sandbox --js-flags=--max-old-space-size=4096 http://localhost:9876/?id=45695334 --headless --disable-gpu --disable-dev-shm-usage --remote-debugging-port=9222 /docgen npm(dns block)/proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --crashpad-handler-pid=5445 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/karma-33534540 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,6098245351063439170,9511589693279506805,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,16365533620647581260,9681406616313523314,4 --trace-process-track-uuid=3190708989122997041 sh(dns block)If you need me to access, download, or install something from one of these locations, you can either: