T05 · Unauthorized Access and Privilege Escalation
- Location
references/ksef-accounting-workflows.md:62- Finding
Automated Ledger Posting Without Mandatory Human Approval
- Content
View full analysis
Vulnerability Details
File Location:
references/ksef-accounting-workflows.md:62-72
Vulnerability Type: Automated modification of financial records beyond the declared approval boundary
Risk Level: HighVulnerable Code Snippet
Rendering diagram...Technical Analysis
The documented workflow periodically retrieves invoices and automatically posts accounting records when an AI classifier reports confidence above
0.8. Model confidence measures predictive certainty; it does not constitute authorization or establish that the classification is legally or financially correct.This workflow conflicts with the explicit constraint in
SKILL.mdrequiring user confirmation before modifying accounting records or taking actions with financial consequences. If implemented as shown, a scheduled process would possess both read access to KSeF invoice data and write access to the accounting database without a mandatory human approval boundary.The package itself is instruction-only and does not execute this workflow. The vulnerability is therefore present in the implementation guidance rather than as active executable behavior inside the Skill.
Attack Path
- An attacker, compromised supplier, or erroneous upstream system submits a crafted or misleading invoice associated with the organization.
- The scheduled process queries KSeF and downloads the invoice without manual intervention.
- Invoice wording or historical supplier data causes the classifier to assign an incorrect category with confidence above
0.8. - The workflow follows the
Auto-postbranch. - Incorrect expense, VAT, payable, or other ledger data is written to the accounting database.
- The erroneous posting may ...[truncated 867 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the
Auto-postbranch with a mandatory approval state such asPending accountant approval. - Restrict scheduled synchronization credentials to read-only KSeF permissions wherever possible.
- Separate invoice ingestion, classification, approval, and ledger posting into distinct services or authorization boundaries.
- Require an authenticated, authorized accountant to approve the proposed account, VAT treatment, amount, accounting period, and counterparty before posting.
- Use short-lived, least-privilege credentials for the posting service and prevent the classification component from writing directly to production ledgers.
- Record the invoice, model version, confidence, proposed entry, approving user, approval timestamp, and final posted entry in an immutable audit trail.
- Treat confidence thresholds only as routing criteria—for example, high confidence may reduce review effort but must not bypass authorization.
- Add duplicate detection, amount reconciliation, supplier verification, VAT-rule validation, and period-lock checks before posting.
- Require additional approval for corrections, unusual amounts, new suppliers, bank-account changes, and tax-sensitive classifications.
- Update the diagram and surrounding documentation to align explicitly with the consent requirement in
SKILL.md.
- Replace the
