Back to skill

Security audit

NotebookLM Auth Bypass

Security checks for vulnerabilities and agentic risk

Overview

This NotebookLM skill performs the advertised automation, but its recovery flow extracts and persistently stores Google/NotebookLM session cookies in ways users should review carefully before installing.

Install only if you are comfortable letting the skill handle live Google/NotebookLM session cookies. Prefer a supported NotebookLM login flow instead. If used, run it in a dedicated low-privilege profile, avoid persistent environment-variable storage, delete ~/.notebooklm/storage_state.json and ~/.notebooklm/auth_payload.json when done, and revoke/re-login the Google session if those files may have been exposed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/auto_playwright.py:29
Finding
Persistent Plaintext Collection and Storage of Authentication Cookies<![CDATA[ ## Vulnerability Details **File Location**: `scripts/auto_playwright.py:29-58` **Vulnerability Type**: Excessive credential collection and insecure plaintext storage **Risk Level**: High ### Vulnerable Code ```python state = browser.storage_state() # Format SameSite exactly as expected by the CLI API for c in state.get("cookies", []): samesite = str(c.get("sameSite", "Lax")).capitalize() if samesite == "None": samesite = "None" c["sameSite"] = samesite print(f"5. Found {len(state.get('cookies', []))} cookies. Saving to disk...") # Ensure the .notebooklm folder exists os.makedirs(os.path.dirname(state_path), exist_ok=True) with open(state_path, "w") as f: json.dump(state, f) env_json = json.dumps({"cookies": state.get("cookies", [])}) with open(payload_path, "w") as f: f.write(env_json) print(f"Saved auth payload to {payload_path}") # Automatically apply to Windows User Environment Variable to bypass the Playwright browser lock bug if sys.platform == "win32": print("Injecting cookies into Windows Environment Variable NOTEBOOKLM_AUTH_JSON...") subprocess.run([ "powershell", "-Command", f'[Environment]::SetEnvironmentVariable("NOTEBOOKLM_AUTH_JSON", \'{env_json}\', "User")' ], check=True) ``` The behavior is also explicitly directed by `SKILL.md:18-22`: ```markdown 4. **Auth Recovery:** If `notebooklm` fails with "Authentication expired", you MUST ask the user for explicit permission before recovering. Propose running `python {WORKSPACE_DIR}/skills/notebooklm-bypass/scripts/auto_playwright.py`. If and only if they approve, run the script. This script steals fresh cookies and automatically injects them into your Windows Environment Variables. Once complete, retry your command. ``` ### Technical Analysis `browser.storage_state()` collects the complete cookie state available to the persistent browser context. The script does not restrict collection to an explicit allowlist of NotebookLM do ...[truncated 2122 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace broad `storage_state()` credential export with an explicit allowlist of the minimum required NotebookLM domains and cookie names. 2. Do not persist duplicate copies of authentication material. 3. Prefer passing short-lived credentials directly to the immediate child process rather than storing them in a user-level environment variable. 4. Use an operating-system credential manager such as Windows Credential Manager, macOS Keychain, or a Linux Secret Service implementation if persistence is unavoidable. 5. On POSIX systems, create credential files with owner-only permissions such as mode `0600`, independent of the user's current `umask`. 6. Define and enforce an expiration and cleanup process for all stored authentication state. 7. Avoid logging cookie values and ensure that exceptions cannot disclose them. 8. Explain exactly which credentials are collected, where they are stored, how long they remain, and how users can revoke or delete them before requesting consent. 9. Consider using the supported `notebooklm login` authentication flow instead of extracting and repackaging browser cookies. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/auto_playwright.py:52
Finding
PowerShell Command Injection Through Cookie-Derived Data<![CDATA[ ## Vulnerability Details **File Location**: `scripts/auto_playwright.py:52-58` **Vulnerability Type**: Command injection **Risk Level**: High ### Vulnerable Code ```python # Automatically apply to Windows User Environment Variable to bypass the Playwright browser lock bug if sys.platform == "win32": print("Injecting cookies into Windows Environment Variable NOTEBOOKLM_AUTH_JSON...") subprocess.run([ "powershell", "-Command", f'[Environment]::SetEnvironmentVariable("NOTEBOOKLM_AUTH_JSON", \'{env_json}\', "User")' ], check=True) ``` The value inserted into the command is generated at `scripts/auto_playwright.py:45-47`: ```python env_json = json.dumps({"cookies": state.get("cookies", [])}) with open(payload_path, "w") as f: f.write(env_json) ``` ### Technical Analysis The script interpolates `env_json`, which contains browser-derived cookie names and values, directly into PowerShell program text. The interpolated value is placed inside a PowerShell single-quoted string. JSON serialization does not provide PowerShell escaping. In particular, a single quote contained in cookie-controlled data is not escaped for a PowerShell single-quoted literal. If data in `env_json` contains a suitable single quote followed by PowerShell syntax, it can terminate the intended string and alter the command parsed by PowerShell. Using a subprocess argument list does not prevent this vulnerability because `powershell -Command` explicitly asks PowerShell to interpret the supplied argument as source code. Exploitation requires an attacker to influence a cookie present in the persistent browser context, so feasibility depends on cookie-setting restrictions and the domains visited by that profile. ### Attack Path 1. An attacker causes the persistent browser profile to store a cookie whose value contains a PowerShell single quote and additional command syntax. This requires a cookie-setting opportunity available to the attacker. 2. The Not ...[truncated 1033 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Do not interpolate cookie data into PowerShell source code. 2. Prefer a native Windows API or a Python library for setting user environment variables. 3. If PowerShell must be used, pass the value through a temporary process environment variable and execute a constant command, for example: ```python child_env = os.environ.copy() child_env["NOTEBOOKLM_AUTH_JSON_VALUE"] = env_json subprocess.run( [ "powershell", "-NoProfile", "-NonInteractive", "-Command", '[Environment]::SetEnvironmentVariable(' '"NOTEBOOKLM_AUTH_JSON", ' '$env:NOTEBOOKLM_AUTH_JSON_VALUE, ' '"User")' ], check=True, env=child_env, ) ``` 4. Remove the temporary variable from the process environment as soon as it is no longer needed. 5. Filter cookies by an explicit domain and name allowlist before processing. 6. Avoid persistent environment-variable storage entirely where possible; use a secure credential vault or direct process-scoped transfer instead. 7. Add tests containing single quotes, semicolons, line breaks, Unicode characters, and PowerShell metacharacters to verify that cookie values can never modify command syntax. ]]>

T08 · Insecure Dependencies

Warning
Location
README.md:35
Finding
Unpinned Executable Playwright and Browser Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `README.md:35-39` **Vulnerability Type**: Unpinned executable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```markdown 3. Ensure you have the Python Playwright package installed (used by the automation script): ```bash pip install playwright playwright install chromium ``` ``` ### Technical Analysis The setup instructions install the latest package resolved under the `playwright` name and then download a Chromium browser artifact. The project does not provide a pinned package version, dependency lock file, hash verification, or documented artifact-integrity procedure. The package name is not an apparent typosquat, and the reviewed project does not demonstrate that the current package or browser artifact is malicious. The risk arises because installation behavior and resolved artifacts can change after the Skill has been reviewed. This dependency is especially sensitive because Playwright and Chromium are subsequently given access to a persistent browser profile containing authenticated Google session data. ### Attack Path 1. A user follows the setup instructions and runs `pip install playwright`. 2. The package installer resolves a mutable package version from the configured Python package index. 3. The user runs `playwright install chromium`, which downloads a browser artifact selected by the installed Playwright release. 4. If the package index, package release, configured mirror, dependency chain, or browser-distribution channel has been compromised, attacker-controlled installation or runtime code executes as the user. 5. The compromised component can access the persistent browser profile and the authentication files used by the Skill. This is a supply-chain attack path and depends on compromise or substitution of a dependency source; no such compromise was observed in the audited files. ### Impact Assessment A compromised dependency would execute with the in ...[truncated 448 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin Playwright to a reviewed exact version rather than installing the latest available release. 2. Provide a dependency lock file with cryptographic hashes, such as a hash-locked `requirements.txt`. 3. Document the trusted package index and discourage installation from untrusted mirrors. 4. Pin and verify the corresponding Chromium revision expected by the reviewed Playwright release. 5. Where supported, verify downloaded browser artifacts using publisher-provided signatures or checksums. 6. Run installation and browser automation as an unprivileged user. 7. Re-review dependency versions before updating the lock file. 8. Consider isolating the browser and Skill in a sandbox with access limited to the dedicated NotebookLM profile. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (19)

Context-Inappropriate Capability

Critical
Confidence
100% confidence
Finding
Stealing browser cookies and placing them into environment variables is an unjustified and highly sensitive action for NotebookLM access. Session cookies can enable account takeover, lateral access, persistence, and leakage through logs or subprocess inheritance, making this an acute credential-compromise risk.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The README explicitly promotes a workflow where an agent refreshes and persists Google authentication cookies, which are effectively bearer tokens for the user's account. Framing this as 'auth recovery' disguises credential collection and reuse, creating a clear risk of unauthorized account access, token theft, and long-lived compromise if the environment variable is exposed.

Intent-Code Divergence

High
Confidence
99% confidence
Finding
The document claims to prevent silent credential harvesting, but the described behavior is still harvesting sensitive Google session cookies and storing them for reuse. This contradiction is a strong deception signal because it normalizes credential exfiltration under a benign label, increasing the chance a user will approve dangerous behavior.

Intent-Code Divergence

High
Confidence
100% confidence
Finding
The embedded SKILL.md excerpt directly instructs the agent to run a script that 'steals fresh cookies' and injects them into environment variables. This is explicit credential theft guidance, and in skill context it is more dangerous because it operationalizes the theft by telling the agent when to do it and how to persist the stolen tokens for future use.

Natural-Language Policy Violations

High
Confidence
99% confidence
Finding
The phrase instructing the agent to 'steal fresh cookies' is direct natural-language guidance to obtain credentials from the browser. In an agent skill, such instructions are especially dangerous because they can cause an autonomous system to facilitate credential theft under the guise of task recovery.

Ssd 3

High
Confidence
99% confidence
Finding
The documentation explicitly tells the agent to obtain fresh authentication cookies and persist them, while presenting the action as routine recovery. This is dangerous because session cookies can grant full access to the user's NotebookLM/Google session, and persistence increases the blast radius and duration of compromise if the host or environment is inspected.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose is NotebookLM control, but the documented behavior includes extracting browser cookies, exporting session material, and injecting it into Windows environment variables. That is a major capability mismatch and strongly indicates concealed credential/session theft under a benign-sounding description.

Intent-Code Divergence

High
Confidence
97% confidence
Finding
Labeling cookie theft as 'auto-recovery for authentication errors' is deceptive and conceals the true security impact of the action. This framing increases the chance that users or agents will approve dangerous credential-access behavior they would otherwise reject.

Description-Behavior Mismatch

High
Confidence
99% confidence
Finding
The documentation explicitly instructs the operator to run a separate script for 'auth recovery' that steals fresh cookies and writes them into Windows environment variables. Embedding such instructions inside a productivity skill disguises credential exfiltration as maintenance activity, making the context more dangerous, not less.

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill omits a clear, prominent warning that its documented recovery flow accesses credential-sensitive browser session material. In the context of an automation skill, this omission materially increases user deception and the risk of uninformed approval of account-compromising actions.

Ssd 1

High
Confidence
99% confidence
Finding
The skill normalizes credential theft by presenting it as a routine recovery workflow, which lowers operator suspicion and operationalizes unsafe behavior. In this skill context, the mismatch between benign productivity tooling and covert session capture makes the pattern particularly dangerous.

Description-Behavior Mismatch

High
Confidence
97% confidence
Finding
The script silently extracts authenticated browser cookies from NotebookLM, writes them to disk, and on Windows persists them into a user environment variable, but the skill description does not disclose this sensitive behavior. This omission undermines informed consent and can lead users to expose reusable session material that could enable account/session hijacking if accessed by other local processes or users.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script extracts browser storage state and cookies from an authenticated NotebookLM session and writes them to predictable files in the user's home directory without warning or confirmation. Those files contain reusable authentication material, so compromise of the local account, backups, logs, or permissive file access could expose active sessions and enable unauthorized access.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script injects extracted authentication cookies into a persistent Windows user environment variable without an explicit warning, confirmation, or discussion of the security tradeoff. This makes sensitive session data broadly available within the user's environment and can facilitate credential leakage, accidental disclosure, or session theft by local tools and child processes.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README discusses extracting and injecting Google auth cookies without adequately warning that these cookies are highly sensitive account credentials. Persisting them in environment variables broadens exposure to logs, subprocesses, shell history, crash reports, and other local tooling, making theft or accidental disclosure more likely.

Skill Enumeration

Medium
Category
Agent Snooping
Content
### Step 3: Install the OpenClaw Skill
1. Clone or download this repository.
2. Move the folder into your OpenClaw workspace's `skills` folder and name it `notebooklm-bypass` so the path looks like this:
   `openclaw/workspace/skills/notebooklm-bypass/SKILL.md`
3. Ensure you have the Python Playwright package installed (used by the automation script):
   ```bash
   pip install playwright
Confidence
80% confidence
Finding
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill advertises executable behavior and references a recovery script, but it declares no explicit tool scope or permissions boundaries. That omission weakens reviewability and allows sensitive shell/file operations to be invoked without clear user-facing constraint, which is especially risky given the auth-handling behavior described later.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
Persisting extracted auth cookies into a Windows user environment variable is not clearly necessary for 'programmatic NotebookLM control' and broadens exposure of sensitive session data beyond the browser/profile context. Environment variables may be readable by other processes in the user context, inherited by spawned processes, and remain available long after the immediate automation task completes.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
# Automatically apply to Windows User Environment Variable to bypass the Playwright browser lock bug
            if sys.platform == "win32":
                print("Injecting cookies into Windows Environment Variable NOTEBOOKLM_AUTH_JSON...")
                subprocess.run([
                    "powershell", "-Command", 
                    f'[Environment]::SetEnvironmentVariable("NOTEBOOKLM_AUTH_JSON", \'{env_json}\', "User")'
                ], check=True)
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Static analysis

No suspicious patterns detected.