Back to skill

Security audit

Liepin V4 Skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a recruitment automation tool, but it can automatically contact candidates, inspect chats, collect phone numbers, and store sensitive candidate data with limited safeguards.

Install only if you are authorized to automate this Liepin account and collect candidate personal data. Review the code first, disable or gate auto-communication, avoid storing phone numbers/message previews unless necessary, protect or shorten retention for output files, and fix cookie handling and output-path sanitization before production use.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/liepin-v4.mjs:398
Finding

Authentication Cookies Are Imported with Security Attributes Disabled

Content
View full analysis
({ name: c.name, value: c.value, domain: '.liepin.com', path: '/', httpOnly: false, secure: false, sameSite: 'Lax' }))); } ``` ### Technical Analysis The Skill reads authentication cookies from `liepin-config.json`, but it does not preserve their original security attributes. Every imported cookie is explicitly assigned: - `httpOnly: false`, making the cookie accessible to JavaScript running in the page. - `secure: false`, allowing the cookie to be treated as eligible for transmission without the protection normally required by the `Secure` attribute. - `sameSite: 'Lax'`, regardless of the cookie's original cross-site policy. - `domain: '.liepin.com'`, broadening the cookie's availability to Liepin subdomains rather than retaining its original host scope. Authentication cookies are security credentials. Removing `HttpOnly` increases the consequences of a cross-site scripting vulnerability or malicious third-party script on an authenticated Liepin page because page JavaScript may be able to read and disclose the cookie. Broadening the domain also increases the number of origins that may receive or interact with it. The configuration file is trusted without schema validation. Cookie names, values, expiry information, and original security properties are not validated or preserved. ### Attack Path 1. The user places valid Liepin authentication cookies in `liepin-config.json`. 2. The Skill reads the file and imports those cookies into the Playwright browser context. 3. The Skill forcibly changes the cookies to `httpOnly: false` and `secure: false` and assigns them to th ...[truncated 1028 chars]
Remediation
View remediation
{ if (!allowedDomains.has(cookie.domain)) { throw new Error(`Unexpected cookie domain: ${cookie.domain}`); } return { name: cookie.name, value: cookie.value, domain: cookie.domain, path: cookie.path || '/', httpOnly: cookie.httpOnly !== false, secure: cookie.secure !== false, sameSite: cookie.sameSite || 'Lax', ...(Number.isFinite(cookie.expires) ? { expires: cookie.expires } : {}), }; }); await ctx.addCookies(cookies); ``` Additional hardening measures: 1. Validate `liepin-config.json` against a strict schema before importing it. 2. Reject cookies for domains outside an explicit allowlist. 3. Preserve the narrowest original cookie domain and path. 4. Require `Secure` for authentication cookies. 5. Preserve `HttpOnly`; do not make authentication cookies available to page JavaScript. 6. Restrict filesystem permissions on `liepin-config.json` to the current user. 7. Prefer a protected Playwright storage-state file or a dedicated operating-system credential store. 8. Ensure cookie values are never printed to logs or included in error messages. 9. Document session revocation procedures in case the configuration file is exposed. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/liepin-v4.mjs:377
Finding

Spreadsheet-Controlled Output Path Permits Directory Traversal

Content
View full analysis
s.name + '(' + s.required + ')').join(', ')); console.log('Target:', targetCount, '| Kill: Desktop/.kill-signal'); console.log('Mode: page-by-page (ant-lpt-pagination)'); console.log('Auto-communicate: >= 55% match'); console.log('================'); const OUT = path.join('C:\\Users', process.env.USERNAME||'10362974', 'Desktop', 'candidates', 'liepin-' + searchTerm); fs.mkdirSync(OUT, { recursive: true }); ``` The resulting directory is subsequently used for file writes, including: ```js fs.writeFileSync(txtPath, info.text, 'utf8'); await page.screenshot({ path: shotPath, clip: { x: pos?.x||0, y: pos?.y||0, width: pos?.w||1008, height: Math.min(final?.scrollH||5000, 5000) } }); fs.writeFileSync(csvPath, '\ufeff' + h + '\n' + rows.join('\n'), 'utf8'); ``` ### Technical Analysis `searchTerm` originates from the Excel configuration field for the job name and is concatenated directly into a directory component. The value is not validated for: - Windows path separators such as `\` or `/`. - Parent-directory components such as `..`. - Absolute or drive-qualified path syntax. - Reserved device names or invalid Windows filename characters. - Excessive path length. The static `liepin-` prefix does not reliably prevent traversal. For example, a value beginning with a separator followed by parent-directory components can produce components such as: ```text liepin-\..\..\target ``` When normal ...[truncated 2171 chars]
Remediation
View remediation
:"/\\|?*\x00-\x1F]/g, '_') .replace(/\.\.+/g, '_') .replace(/[. ]+$/g, '') .slice(0, 80); if (!sanitized || sanitized === '.' || sanitized === '..') { throw new Error('Invalid job name'); } return sanitized; } const directoryName = `liepin-${safeDirectoryName(searchTerm)}`; const OUT = path.resolve(outputRoot, directoryName); const relative = path.relative(outputRoot, OUT); if ( relative === '' || relative.startsWith(`..${path.sep}`) || relative === '..' || path.isAbsolute(relative) ) { throw new Error('Output path escapes the approved output directory'); } fs.mkdirSync(OUT, { recursive: true }); ``` Additional hardening measures: 1. Use a generated identifier for the directory and store the original job name only in metadata. 2. Reject all path separators rather than attempting to interpret them. 3. Enforce a conservative allowlist, such as letters, digits, spaces, hyphens, underscores, and approved Unicode characters. 4. Check for Windows reserved device names, including `CON`, `PRN`, `AUX`, `NUL`, `COM1`, and `LPT1`. 5. Use exclusive file creation or explicit overwrite confirmation where existing output files must not be replaced. 6. Apply the containment check immediately before every security-sensitive write if paths can be modified later. 7. Restrict output-directory permissions because generated files contain candidate personal information. 8. Add automated tests covering separators, `..`, drive letters, UNC paths, trailing dots, reserved names, and Unicode normalization edge cases. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata and overview frame the capability as job search/result scraping, but the body describes collecting candidate resumes, extracting contact details, storing screenshots/text locally, and initiating outreach. This mismatch reduces transparency and can cause operators or reviewers to authorize a much more privacy-invasive workflow than they intended, increasing the risk of unauthorized personal-data collection and misuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script captures resume text, takes screenshots, and writes candidate data to disk without any warning, consent flow, or visible safeguards for handling sensitive personal information. In this context the data includes employment history, education, and potentially contact details, so silent collection and storage materially increases privacy, compliance, and insider-misuse risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill description says it performs job search, scraping, structured output, and screenshots, but this code also automates candidate outreach by clicking '立即沟通' and confirming the action. Hidden side effects that trigger external actions against third parties are dangerous because operators may run the skill expecting passive data collection, while it actually performs account-affecting actions that can spam users, violate platform rules, and create legal or reputational risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code opens the IM panel, reads chat contents, determines whether candidates replied, and extracts phone numbers from messages, but the skill description does not disclose this surveillance and contact harvesting behavior. This is risky because it processes sensitive communications and personal data beyond the stated scope, which can violate user expectations, privacy requirements, and data handling policies.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code extracts phone numbers from resumes and chat replies, stores them in records, and writes them to CSV and progress files along with notes about reply status and message previews. Persisting sensitive personal data and private communication content to local files without access controls or minimization is dangerous because it enables unauthorized disclosure, secondary misuse, and long-lived retention of data that may have been revealed only within the platform context.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Candidates with scores above the threshold are automatically contacted with no confirmation step immediately before the outbound action. Automatic outreach to real users is dangerous because it can send unintended communications at scale, trigger account abuse complaints, and create legal, policy, or brand harm if the matching logic is wrong or the operator did not intend to message anyone.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation describes saving candidate CSVs, resume screenshots, text extracts, and contact information to a local Desktop path without a prominent warning about handling sensitive personal data. This can lead users to store PII insecurely on unmanaged endpoints, increasing exposure through local compromise, accidental sharing, or excessive retention.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The header comment describes searching, scoring, screenshotting, and writing to a candidate database, but omits the fact that the script also initiates conversations, sends messages, and inspects IM replies. Misleading documentation is security-relevant here because it conceals higher-risk behaviors involving third-party interaction and sensitive data collection, reducing the chance of informed review or operator consent.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script injects stealth modifications to hide automation indicators such as navigator.webdriver, plugins, and languages. In the context of a recruitment-platform automation skill, anti-detection behavior increases concern because it suggests deliberate bypass of platform bot-detection controls and can facilitate undisclosed scraping or messaging at scale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script forces browser language-related properties to Chinese and later configures the browser context and HTTP headers for zh-CN. This is a natural-language/locale policy concern because it imposes a specific language/locale without user opt-in or documented justification in the file.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The declared purpose focuses on job retrieval, but the code actually saves candidate resumes, schools, work history indicators, contact details, match scores, and communication status into local CSV and progress files. This mismatch is dangerous because users may unknowingly process regulated personal data, expanding the privacy and compliance impact beyond what the skill claims to do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The browser context is created with locale 'zh-CN' and timezone 'Asia/Shanghai', and outgoing headers force 'Accept-Language' to Chinese. This is a locale restriction presented as a fixed behavior rather than a user-selectable option, which can violate language/locale choice expectations.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.