T09 · Insecure Skill Coding Practices
- Location
skill.md:129- Finding
Sensitive Chrome Authentication Data Copied to a Predictable Temporary Directory
- Content
View full analysis
Vulnerability Details
File Location:
skill.md, lines 129–140
Vulnerability Type: Insecure temporary storage of sensitive browser data
Risk Level: HighVulnerable Code
bash pkill -9 -f "Google Chrome" mkdir -p /tmp/chrome_debug_profile cp -r ~/Library/Application\ Support/Google/Chrome/Default/{Cookies,"Login Data","Web Data",Preferences,"Local State"} \ /tmp/chrome_debug_profile/ 2>/dev/null nohup "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \ --remote-debugging-port=9222 \ --user-data-dir="/tmp/chrome_debug_profile" \ --no-first-run --disable-sync \ > /tmp/chrome_debug.log 2>&1 &Technical Analysis
The setup procedure copies Chrome's
Cookies,Login Data,Web Data,Preferences, andLocal Statefiles into the fixed path/tmp/chrome_debug_profile. These files can contain authenticated session material, saved-login metadata, autofill information, and cryptographic state associated with browser-stored secrets.The procedure does not:
- Create the destination with restrictive permissions such as mode
0700. - Use an unpredictable, securely created temporary directory.
- Verify ownership or reject an existing symbolic link or attacker-controlled directory.
- Delete the copied profile after the skill finishes.
- Limit the copied data to the LinkedIn session needed for the task.
Because
mkdir -paccepts an existing path, a local attacker may prepare the destination or manipulate its contents before the user runs these commands. The predictable path also makes the copied browser data straightforward to locate.The browser is additionally launched with Chrome DevTools remote debugging on port 9222. The command does not explicitly bind the debugging endpoint to loopback. Any process able to reach that endpoint may be able to inspect pages, execute JavaScript in authenticated contexts, navigate the browser, and extract displayed data.
Finally,
pkill -9 -f "Google Chrome"forcibly termin ...[truncated 1716 chars]- Create the destination with restrictive permissions such as mode
- Remediation
View remediation
Remediation Suggestions
-
Do not copy the user's default Chrome profile data. Create a dedicated browser profile for this skill and require the user to log in to LinkedIn manually:
bash profile_dir="$(mktemp -d "${TMPDIR:-/tmp}/linkedin-chrome.XXXXXX")" chmod 700 "$profile_dir" "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \ --remote-debugging-address=127.0.0.1 \ --remote-debugging-port=9222 \ --user-data-dir="$profile_dir" \ --no-first-run \ --disable-sync -
Never copy
Cookies,Login Data,Web Data, orLocal Statefrom a general-purpose browser profile. This exceeds the minimum data access required for candidate searching. -
Bind DevTools explicitly to loopback with
--remote-debugging-address=127.0.0.1. Where supported, use a randomized port or authenticated transport and ensure host firewall rules prevent non-local access. -
Use secure temporary-directory creation. Create the directory with
mktemp -d, enforce mode0700, verify ownership, and avoid following pre-existing links. -
Implement cleanup. Close only the dedicated Chrome process and remove the temporary profile at the end of the run. Clearly warn the user that cleanup removes that profile's browser state.
-
Avoid broad process termination. Replace
pkill -9 -f "Google Chrome"with process tracking for the dedicated browser instance. Attempt graceful termination before considering a forced kill. -
Minimize retained personal data. Store only candidate information necessary for deduplication and evaluation, apply restrictive permissions to
linkedin-save, and document retention and deletion procedures.
-
