Back to skill

Security audit

Tally Prime CA

Security checks for vulnerabilities and agentic risk

Overview

This skill is for legitimate TallyPrime accounting automation, but it combines sensitive financial write access with broad setup commands and weak endpoint scoping that users should review carefully before installing.

Install only in a controlled environment where TALLY_URL is locked to the intended TallyPrime instance, preferably loopback in production. Do not let the agent run sudo or install global npm packages during normal use; preinstall and pin dependencies through an administrator-controlled process. Treat every create, alter, cancel, master setup, inventory setup, and report export as live financial activity requiring explicit company and user confirmation.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:54
Finding
Mutable third-party packages are downloaded and executed without integrity controls<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:54-83`, `SKILL.md:109-126`, and `SKILL.md:188-198` **Vulnerability Type**: Supply-chain exposure through mutable and unpinned npm/npx dependencies **Risk Level**: Medium ### Vulnerable Code ```bash npm install -g tallyca ``` ```bash npm install -g tallyca@latest ``` ```bash npm view tallyca version ``` ```bash sudo yum install -y \ alsa-lib atk at-spi2-atk cups-libs libdrm libXcomposite \ libXdamage libXrandr mesa-libgbm pango gtk3 npx playwright install chromium npx playwright install-deps chromium ``` ```bash sudo apt-get update sudo apt-get install -y \ libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \ libxcomposite1 libxdamage1 libxrandr2 libgbm1 \ libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0 npx playwright install chromium npx playwright install-deps chromium ``` The recovery workflow also states: ```text If missing or too old: npm install -g tallyca@latest ``` The maintainer instructions identify the dependency ambiguously: ```text Publish tallyca to npm (tally-pdf-cli package). ``` ### Technical Analysis The Skill directs the agent to download and execute mutable third-party packages. In particular, `tallyca@latest` does not identify an immutable, audited artifact. Its effective contents can change after this Skill has been reviewed. npm installation can run package lifecycle scripts such as `preinstall`, `install`, and `postinstall`. Those scripts execute with the permissions of the account running npm. A compromised publisher account, malicious package update, registry compromise, or dependency-confusion event could therefore turn the documented installation step into arbitrary local code execution. The unversioned `npx playwright` commands introduce similar risk. Depending on the environment and locally installed packages, `npx` may retrieve executable package content from the npm registry. No lockfile, integrity hash, package provenance check, or trusted-publi ...[truncated 2065 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `tallyca@latest` with an exact, reviewed package version. 2. Verify and consistently document the official package name, publisher, registry, and source repository. Resolve the `tallyca` versus `tally-pdf-cli` ambiguity. 3. Pin all direct and transitive dependencies through a lockfile where deployment architecture permits. 4. Verify package integrity using registry integrity metadata, checksums, signatures, or npm provenance attestations. 5. Install dependencies locally in a dedicated application directory rather than globally. 6. Run installation and PDF generation under an isolated, unprivileged service account. 7. Pin Playwright to an audited version and invoke the locally installed binary rather than an unversioned `npx` command. 8. Disable npm lifecycle scripts with `--ignore-scripts` unless they are explicitly required. If required, audit the relevant scripts before deployment. 9. Perform upgrades through a controlled maintenance process rather than automatically installing the newest registry release during normal Skill execution. 10. Use dependency scanning and publisher-change monitoring before approving new versions. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:15
Finding
Sensitive accounting requests can be redirected to an arbitrary plaintext endpoint<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:15-28`, `SKILL.md:236-254`, `SKILL.md:385-415`, and `reference/reports.md:5-7` **Vulnerability Type**: Unrestricted, potentially plaintext destination for sensitive accounting traffic **Risk Level**: High ### Vulnerable Code The endpoint is supplied entirely through an environment variable: ```yaml requires: env: - TALLY_URL metadata: openclaw: requiredEnv: - TALLY_URL bins: - curl - tallyca primaryCredential: TALLY_URL ``` The Skill sends requests directly to that value: ```text Connect to a locally running TallyPrime instance via its XML-over-HTTP interface. All requests are HTTP POST to $TALLY_URL (commonly http://localhost:9000) with an XML body. ``` Its connectivity check performs no endpoint identity or authorization verification: ```bash curl -s --max-time 5 "$TALLY_URL" ``` Remote tunnel endpoints are explicitly supported: ```text | Environment | Where B runs | Tally URL | Bridge exposure | | Production | Client mini-PC with TallyPrime | http://localhost:9000 | ngrok http 8787 (or Cloudflare Tunnel) | | Dev | Same EC2 as A (second OpenClaw) | ngrok URL to dev Tally | localhost:8787 or ngrok | ``` ```text Dev: Both OpenClaws on one Ubuntu EC2; B uses your existing Tally ngrok URL in TALLY_URL. ``` ```text | TALLY_URL | http://localhost:9000 (prod) or dev ngrok Tally URL | ``` The report instructions confirm that sensitive requests use this destination: ```text - All requests are HTTP POST to $TALLY_URL with Content-Type: application/xml. - Use YYYYMMDD dates in SVFROMDATE / SVTODATE. - Always set SVCURRENTCOMPANY to the exact company name as shown in Tally. - Preferred export format: $$SysName:XML (HTML is also supported). ``` ### Technical Analysis `TALLY_URL` controls the destination of report exports and accounting write requests, but the Skill does not require a safe scheme, loopback address, approved-host allowlist, authenticated conne ...[truncated 3292 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Enforce loopback-only destinations by default, such as `127.0.0.1`, `::1`, or an explicitly approved local socket. 2. Reject unexpected URL schemes, embedded credentials, redirects, link-local destinations, and unapproved hostnames or ports. 3. Maintain an explicit endpoint allowlist for deployments that genuinely require remote Tally access. 4. Require HTTPS with normal certificate and hostname validation for every remote endpoint. 5. Do not disable TLS verification. For high-assurance deployments, pin a private CA or expected server certificate. 6. Add endpoint authentication and request-integrity protection, such as mutually authenticated TLS or signed requests with replay protection. 7. Verify a server-specific identity or challenge response rather than accepting any nonempty status response. 8. Separate read-only report access from voucher and master write access. Use distinct credentials or service boundaries where supported. 9. Require explicit user approval before enabling a non-loopback `TALLY_URL`. 10. Redact sensitive request and response bodies from logs, diagnostics, and error messages. 11. Document tunnel authentication, access-control, expiry, and rotation requirements instead of relying only on possession of a public tunnel URL. 12. Prevent configuration changes by untrusted users and validate `TALLY_URL` again immediately before each accounting operation. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (33)

Ae1

High
Category
analysis-evasion
Content
blish a newer **breaking** or **must-have** CLI release, **edit this line** in `SKILL.md` to the new minimum and redeploy the skill so agents reinstall if neede
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
blish a newer **breaking** or **must-have** CLI release, **edit this line** in `SKILL.md` to the new minimum and redeploy the skill so agents reinstall if neede
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
blish a newer **breaking** or **must-have** CLI release, **edit this line** in `SKILL.md` to the new minimum and redeploy the skill so agents reinstall if neede
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

External Script Fetching

High
Category
Supply Chain
Content
| Connection refused / timeout | TallyPrime not running or wrong port | Open TallyPrime; confirm port; check `$TALLY_URL` |
| Response doesn’t contain “Server is Running” | Wrong URL or Tally integration not enabled | Verify TallyPrime is running and integration is enabled |
| XML parser throws `ParseError` / "no element found" | Export Data responses are XML fragments (no single root) — this is by design | Use Python regex instead of `xml.etree.ElementTree`; see parsing guide in `reference/reports.md` |
| `curl ... > file` produces truncated or empty file | Shell redirect can silently truncate in compound commands | Use `curl --output /tmp/file.xml` (the `-o` flag) |
| `Could not find Report 'X'` | Wrong `REPORTNAME` | Use report names in `reference/reports.md`; if still failing, verify in TallyPrime Developer |
| `Could not find Collection 'X'` | Collection not available | Use custom TDL pattern (see `reference/reports.md`) |
| `Ledger 'X' does not exist` | Missing ledger master | Create ledger first (see `reference/masters.md`) |
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Hidden Instructions

High
Category
Prompt Injection
Content
When `CLASSNAME` is set, always include all four GST header fields. Missing any one of them will cause Tally to reject the voucher or save it with incorrect GST treatment.

```xml
<CLASSNAME>Purchase @ 18 %</CLASSNAME>   <!-- exact name as configured in Tally -->
<CMPGSTIN>COMPANY_GSTIN</CMPGSTIN>
<PARTYGSTIN>PARTY_GSTIN</PARTYGSTIN>
<GSTREGISTRATIONTYPE>Regular</GSTREGISTRATIONTYPE>
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
</BILLALLOCATIONS.LIST>
            </LEDGERENTRIES.LIST>

            <!-- Purchase / expense ledger -->
            <LEDGERENTRIES.LIST>
              <LEDGERNAME>PURCHASE_LEDGER</LEDGERNAME>
              <ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill description says it only processes structured bridge JSON, but it also instructs the agent to generate PDFs from arbitrary raw text via `tallyca`. That scope expansion weakens trust boundaries: a deployment expecting tightly validated bridge input may unexpectedly let the agent process untrusted free-form text and invoke a local CLI, increasing prompt-injection and command-construction risk.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The skill includes `npm install -g` and `npm view` upgrade instructions unrelated to the minimal act of posting vouchers to Tally. Giving an agent package-management authority expands its capability to fetch and install remote code, creating avoidable supply-chain and privilege-escalation risk if the environment permits execution.

Context-Inappropriate Capability

Medium
Confidence
94% confidence
Finding
The file directs installation of OS packages and Playwright browser dependencies, including commands that alter the host system. This materially broadens the skill from Tally interaction into host administration, which is dangerous because an agent following these instructions could modify the machine, increase attack surface, and execute remote installer logic under elevated privileges.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Amazon Linux 2 / AL2023**

```bash
sudo yum install -y \
  alsa-lib atk at-spi2-atk cups-libs libdrm libXcomposite \
  libXdamage libXrandr mesa-libgbm pango gtk3
npx playwright install chromium
Confidence
95% confidence
Finding
The skill content includes `sudo yum install -y ...`, which is an instruction to perform privileged host modification. In an agent context, any path that encourages or normalizes sudo-level execution is dangerous because it can turn a limited application skill into a root-capable system administrator, enabling broad compromise if abused or prompt-injected.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
**Ubuntu / Debian**

```bash
sudo apt-get update
sudo apt-get install -y \
  libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
  libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
Confidence
95% confidence
Finding
This line explicitly instructs `sudo apt-get update`, a privileged system-management action unrelated to the core accounting task. In context, it increases risk because the skill runs near sensitive financial systems and should not direct the agent to alter package state on the host.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
```bash
sudo apt-get update
sudo apt-get install -y \
  libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
  libxcomposite1 libxdamage1 libxrandr2 libgbm1 \
  libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0
Confidence
95% confidence
Finding
The instruction `sudo apt-get install -y ...` authorizes privileged installation of host packages. If an agent can act on such instructions, the environment's trust boundary is broken, and compromise of the agent or malicious prompting could lead to arbitrary system changes on the machine hosting Tally and financial data.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The 'When to use this skill' section expands the role beyond the declared bridge-posting/report-reading purpose to include PDF generation, master management, and voucher alteration/cancellation. Broader capabilities increase the blast radius of any misuse, especially destructive accounting actions like altering or cancelling vouchers when the deployment may have assumed a narrower, safer role.

Description-Behavior Mismatch

Medium
Confidence
93% confidence
Finding
The reference file documents creation of stock groups, UOMs, stock items, and godowns, which expands capability beyond the stated manifest scope of posting vouchers and reading reports. In an automation skill that can already send XML to TallyPrime, undocumented master-creation patterns enable broader state-changing actions and increase the chance an agent will create or alter inventory structure without explicit authorization or operator awareness.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The markdown provides ready-to-use XML import templates for creating masters and posting item invoices but does not prominently warn that these operations modify live accounting and inventory data. In this skill context, such examples can be copied directly by an agent or operator into production workflows, increasing the risk of unintended ledger, inventory, or voucher changes with financial reporting consequences.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The file documents capabilities to create and alter groups and ledgers, while the stated skill scope is voucher posting and report reading. In an agent setting, undocumented write capabilities materially expand what the skill can do and can be invoked to change accounting masters, creating unauthorized or unexpected modification paths in financial data.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The documentation presents Tally 'Import Data' XML for masters without an explicit warning that these actions modify persistent accounting data. In practice, this can cause an agent or operator to treat examples as harmless reference material and execute destructive or irreversible writes without adequate review.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The new-company setup section adds bulk initialization behavior that is outside the declared skill scope and enables creation of multiple accounting ledgers in one run. This broadens the effective authority of the skill and raises the risk of accidental or unauthorized chart-of-accounts changes, especially if the wrong company context is selected.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The instruction to run all setup blocks for a new company omits a warning that this is a bulk write operation that can duplicate ledgers or alter the accounting structure if executed against the wrong company. In a financial system, mistaken bulk initialization can create reconciliation errors, tax misclassification, and operational disruption that are difficult to unwind.

Description-Behavior Mismatch

Medium
Confidence
88% confidence
Finding
The manifest describes this skill as posting vouchers and reading accounting reports such as day book, trial balance, P&L, balance sheet, outstandings, and GST. This file explicitly states it contains templates for exporting both accounting and inventory reports, and later includes a Stock Summary export, which extends beyond the manifest’s stated read scope.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This markdown file describes sending report export requests over HTTP POST to `$TALLY_URL`, and the surrounding templates cover sensitive accounting data such as vouchers, balances, receivables, payables, GST reports, and company lists. Under SQP-2 for markdown files, user-facing documentation should warn about privacy or system-impacting behavior when skill behavior can expose or transfer sensitive data, but no such warning is present here.

Static analysis

No suspicious patterns detected.