advpl-code-generation
Audited by Socket on Sep 15, 2026
3 alerts found:
AnomalySecurityx2The fragment appears to be ordinary REST and database integration code, not intentional malware. The principal security concern is potential SQL injection through direct concatenation of cWhere into TCQuery; this input must be constrained or replaced with parameterized query construction. Wildcard CORS is also overly permissive for authenticated APIs, and pagination, authorization scope, and sensitive-field exposure require validation. No suspicious exfiltration, obfuscation, persistence, or destructive behavior is visible in this portion.
No evidence of supply-chain malware, data theft, backdoors, obfuscation, or unauthorized external activity is present. The code does contain a material SQL injection risk because cCNPJ and cFiltro are concatenated into TCQuery statements, and BuildQuery permits raw cWhere and cOrderBy fragments. Use parameterized queries or strict allowlisted construction, and add operation-result checks and authorization/validation controls.
The visible fragment appears to be legitimate Protheus approval and email workflow sample code, not malware. It contains a serious hardcoded SMTP credential and security weaknesses from dynamically concatenated SQL queries. Email delivery and attachment handling can disclose business data if inputs or database records are compromised. Credentials should be moved to protected configuration or a secret store, and SQL values should use supported parameterization or strict escaping. No obfuscation, destructive behavior, reverse shell, exfiltration beyond the explicitly intended email function, or persistence mechanism is visible.