AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 18 Bitcoin

plugin: Allow json_object and json_group_array functions in sql plugin

Public commit record

What the developer wrote

Authored by ShahanaFarooqui

78/100 · Adequate
plugin: Allow json_object and json_group_array functions in sql plugin

Changelog-Added: Plugins: `sql` also supports functions `json_object(key1, value1, ...)` to construct JSON objects and `json_group_array(value)` to aggregate rows into JSON array.

Security Considerations
- No new SQL injection risks: Functions only process explicitly provided column values (no arbitrary string parsing).
- Explicit column requirements: Wildcards (*) are not supported, all fields must be named (e.g., json_object('peer_id', id)).
- Permission-bound data access: Functions adhere to the same table/row permissions as the underlying query.

Performance Impact
- Optimized native execution: Leverages SQLite’s built-in JSON1 extension (when available) for efficiency.
- Moderate CPU overhead: Complex nesting may impact performance on large datasets but still faster than application-layer JSON conversion.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Names security-relevant behavior explicitly
The short version

What changed, and why it matters

This commit adds two SQLite JSON helper functions, json_object and json_group_array, to the list of functions allowed by Core Lightning's SQL plugin. The change is a small whitelist expansion in the plugin's query authorization code. The commit message explicitly states this does not introduce new SQL injection risks and that the functions follow existing table and row permissions. There is no direct evidence in the commit of a security vulnerability.

Recommended action

No immediate security action required. Review the SQL plugin's authorization model and ensure json_object/json_group_array cannot be combined with other features to bypass permissions or leak data. Consider whether nested JSON construction could enable denial-of-service via large result sets, as noted in the commit's performance considerations.

Security signals we found

01

Whitelist expansion for SQLite JSON1 functions in SQL plugin authorization callback

02

Commit message includes explicit security considerations claiming no new SQL injection risk and permission-bound access

03

No changes to input validation, query parsing, or permission logic in the diff

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.