MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / store_authorizer

Function store_authorizer

src/store/store.c:936–950  ·  view source on GitHub ↗

SQLite authorizer: deny dangerous operations that could be exploited via * SQL injection through the Cypher→SQL translation layer. */

Source from the content-addressed store, hash-verified

934/* SQLite authorizer: deny dangerous operations that could be exploited via
935 * SQL injection through the Cypher→SQL translation layer. */
936static int store_authorizer(void *user_data, int action, const char *p3, const char *p4,
937 const char *p5, const char *p6) {
938 (void)user_data;
939 (void)p3;
940 (void)p4;
941 (void)p5;
942 (void)p6;
943 switch (action) {
944 case SQLITE_ATTACH: /* ATTACH DATABASE — could create/read arbitrary files */
945 case SQLITE_DETACH: /* DETACH DATABASE */
946 return SQLITE_DENY;
947 default:
948 return SQLITE_OK;
949 }
950}
951
952static cbm_store_t *store_open_internal(const char *path, bool in_memory, bool create) {
953 cbm_store_t *s = calloc(CBM_ALLOC_ONE, sizeof(cbm_store_t));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected