Back to skill

Security audit

Telegram Premium Features

Security checks for vulnerabilities and agentic risk

Overview

This non-executable guide is coherent with premium subscription development, but its production-oriented payment and entitlement examples contain unsafe patterns that could cause financial or access-control problems if reused directly.

Review this skill before installing or using it as implementation source material. Treat its code as illustrative only: deny unknown features by default, make quota and coupon use atomic, verify transaction ownership before refunds, require confirmation/audit trails for refunds and downgrades, handle all database and gateway errors, and add explicit privacy and payment-processing disclosures.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (4)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:175
Finding

Fail-Open Feature Authorization Allows Premium Access Bypass

Content
View full analysis
= requiredTier, nil } ``` ### Technical Analysis The authorization function grants access whenever a feature identifier is absent from the hard-coded requirements map. This is a fail-open authorization design. A protected feature can therefore become publicly accessible if: - A developer adds a new feature but forgets to add it to the map. - A handler and the authorization map use different spellings. - The feature identifier is derived from attacker-controlled request data. - A refactor changes the identifier without updating the map. Authorization systems should deny unknown resources by default. The current behavior instead treats an unrecognized identifier as evidence that no authorization is required. ### Attack Path 1. The attacker identifies a premium operation whose feature identifier is missing from the requirements map, or supplies an unrecognized identifier if the request controls it. 2. The middleware passes that identifier to `CheckFeatureAccess`. 3. The map lookup returns `exists == false`. 4. The function returns `true, nil` without checking a required subscription tier. 5. The protected handler executes for an unauthorized use ...[truncated 479 chars]
Remediation
View remediation
= requiredTier, nil ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:428
Finding

Non-Atomic Quota Enforcement Permits Concurrent Limit Bypass

Content
View full analysis
0, remaining, nil } func (m *SubscriptionManager) UseQuota(ctx context.Context, userID int64, quotaType string, amount int64) error { _, err := m.db.ExecContext(ctx, `INSERT INTO user_quotas (user_id, quota_type, used_value, reset_at) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE used_value = used_value + VALUES(used_value)`, userID, quotaType, amount, getNextResetTime()) return err } ``` The upload handler performs these operations separately and ignores the increment error: ```go // Check and use quota allowed, _, err := s.subManager.CheckQuota(ctx, userID, "files_daily") if err != nil { return nil, err } if !allowed { return nil, status.Errorf(codes.ResourceExhausted, "Daily file upload limit reached. Upgrade for unlimited uploads.") } // Use quota s.su ...[truncated 1913 chars]
Remediation
View remediation
= ? AND used_value + ? <= limit_value; ``` The application must authorize processing only when exactly one row is updated. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/v1.5.0-refunds.md:6
Finding

Refund Operation Does Not Verify Transaction Ownership

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/v1.3.0-coupons.md:23
Finding

Coupon Redemption Race and Missing Pricing Constraints Enable Promotion Abuse

Content
View full analysis
0 && coupon.UsedCount >= coupon.MaxUses { return 0, errors.New("coupon exhausted") } // Calculate discount plan := s.getPlan(planID) var discount float64 if coupon.Type == "percentage" { discount = plan.Price * coupon.Value / 100 } else { discount = coupon.Value } // Record usage s.dao.IncrementCouponUsage(ctx, couponCode) return plan.Price - discount, nil } ``` ### Technical Analysis The implementation checks `UsedCount` and increments it in separate operations. Concurrent redemption requests can all observe a count below `MaxUses` before any increment becomes visible, allowing the coupon to exceed its configured redemption limit. The result of `IncrementCouponUsage` is ignored, so a failed increment still returns a discounted price. The schema defines `min_amount` and `applicable_plans`, but this function does not enforce either restriction. A coupon can therefore be applied to a plan for which it was not intended or to a purchase below the required minimum. The calculated price is not bounded. A fixed discount greater than the plan price produces a negative result, and percentage values are not restricted to a safe range in the shown schema or function. ### Attack Path Concurrent-redemption path: 1. The ...[truncated 1193 chars]
Remediation
View remediation
= NOW() AND (max_uses = 0 OR used_count < max_uses); ``` The discounted order must be rejected if the update affects no rows. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says 'Use when building membership systems, payment integration, subscription lifecycle, coupons, analytics, and global payment solutions,' which describes a very wide range of common development tasks without clear trigger boundaries. For skill routing, this can overlap with many ordinary backend or product-engineering requests and may cause unintended invocation because no explicit exclusions or narrower activation phrases are provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The guide includes payment checkout and webhook flows that transmit user email, subscription metadata, and payment-related events to external processors, but it does not explicitly instruct implementers to provide clear user-facing disclosure/consent about third-party payment processing. In payment contexts, omission of transparency can create privacy, compliance, and trust risks, especially when integrating external providers and handling webhook-driven account state changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file uses Chinese for the title and descriptive content, which can impose a specific language on users without indicating that Chinese is optional or region-specific. The policy explicitly calls for flagging language or locale constraints when no user choice or opt-in is provided.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file describes automatic renewal charging, renewal-failure handling, and automatic downgrade to a free tier after a grace period, but it does not include any warning to users about these behaviors or their impact on billing and service level. Under the markdown-file criteria for missing user warnings, behaviors affecting user data, finances, or account state should be disclosed clearly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The document’s headings, comments, and explanatory text are entirely in Chinese, with no indication that language selection is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The refund flow immediately performs an irreversible entitlement change by downgrading the user after a successful gateway refund, but the documented skill flow does not show any user confirmation, warning, review step, or safeguard against accidental/admin-triggered execution. In a subscription and monetization skill, this can cause unintended service loss, support disputes, and inconsistent account state if the refund was initiated in error or if downstream state changes fail silently.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document is written entirely in Chinese, including headings and explanatory comments, with no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. This creates a natural-language policy concern because it imposes a specific language by default without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The code collects and derives user-specific engagement metrics and churn predictions from behavioral data without any visible indication of user notice, consent, opt-out controls, or privacy governance. In a premium/membership monetization skill, this profiling can create privacy, compliance, and trust risks because it enables individualized behavioral inference tied to a specific user ID.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example analytics call includes a raw user identifier in the event payload, which creates a privacy and data-minimization issue if implemented as shown. In a subscription and pricing experiment context, linking conversion behavior directly to persistent user IDs can enable user profiling and may create compliance risk under privacy requirements if notice, consent, retention limits, or pseudonymization are not applied.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file title and surrounding instructional content are written entirely in Chinese, which imposes a specific language on users/readers without any visible opt-in or explanation that the skill is region-specific. The policy allows locale constraints only when they are clearly documented and justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The document includes prominent Chinese-only explanatory text while the rest of the guide is largely in English, but it does not tell users that bilingual content is intentional or offer a language preference. This can violate language/locale policy where skills should not impose a language without opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

All headings, comments, and descriptive text in the file are in Chinese, with no indication that this language choice is optional or intentionally limited to a specific locale or audience. The policy requires flagging language or locale constraints when a specific language is effectively forced without user opt-in or justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The file is entirely written in Chinese, including the title and operational checklist, with no indication that users may choose another language or locale. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale constraint is clearly documented and justified.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.