Back to Home
DataZooDE icon

flapi

by DataZooDE

Overview

A fast and flexible API gateway powered by DuckDB, providing configurable HTTP and MCP endpoints for data access and management, with built-in caching, authentication, and rate-limiting features.

Installation

Run Command
./build/release/flapi --port 8080 --config examples/flapi.yaml

Environment Variables

  • FLAPI_CONFIG_SERVICE_TOKEN
  • FLAPI_TOKEN
  • DB_USER
  • POSTGRES_USER

Security Notes

Critical SQL Injection Vulnerability: The `QueryExecutor` directly executes SQL query strings (`duckdb_query(conn, query.c_str(), &result)`) which are constructed from Mustache templates and user-provided parameters. While a `RequestValidator` attempts to prevent SQL injection using regex, this method is fundamentally insufficient and prone to bypasses, posing a severe risk. This allows malicious users to execute arbitrary SQL commands including data exfiltration, modification, or deletion. Additionally, `executeWrite` splits queries by semicolon, enabling multi-statement injection. It is recommended to use parameterized queries with prepared statements for all user-controlled inputs. Other security aspects like JWT/OIDC authentication are implemented using standard libraries (jwt-cpp, OpenSSL) which is a positive, and AWS Secrets Manager integration leverages DuckDB's secret management, but the core SQL execution flaw is critical.

Similar Servers

Stats

Interest Score45
Security Score3
Cost ClassLow
Stars64
Forks3
Last Update2026-01-19

Tags

API GatewayDuckDBC++HTTP ServerData APIConfiguration ManagementMCP ProtocolCLI