Version in base suite: 3.5.0+dfsg-2+deb13u1 Base version: shibboleth-sp_3.5.0+dfsg-2+deb13u1 Target version: shibboleth-sp_3.5.0+dfsg-2+deb13u2 Base file: /srv/ftp-master.debian.org/ftp/pool/main/s/shibboleth-sp/shibboleth-sp_3.5.0+dfsg-2+deb13u1.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/s/shibboleth-sp/shibboleth-sp_3.5.0+dfsg-2+deb13u2.dsc changelog | 14 ++ patches/Use-bound-parameters.patch | 181 +++++++++++++++++++++++++++++++++++++ patches/series | 1 3 files changed, 195 insertions(+), 1 deletion(-) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpzqotbh7b/shibboleth-sp_3.5.0+dfsg-2+deb13u1.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpzqotbh7b/shibboleth-sp_3.5.0+dfsg-2+deb13u2.dsc: no acceptable signature found diff -Nru shibboleth-sp-3.5.0+dfsg/debian/changelog shibboleth-sp-3.5.0+dfsg/debian/changelog --- shibboleth-sp-3.5.0+dfsg/debian/changelog 2025-09-06 09:46:12.000000000 +0000 +++ shibboleth-sp-3.5.0+dfsg/debian/changelog 2026-11-30 13:41:55.000000000 +0000 @@ -1,3 +1,15 @@ +shibboleth-sp (3.5.0+dfsg-2+deb13u2) trixie-security; urgency=high + + * [3e0f644] New patch: Use bound parameters. + Fix SQL injection vulnerability in Service Provider ODBC plugin + Additional SQL injection vulnerabilities due to non-portable + string escaping were identified, and this could be creatively + exploited through specially crafted inputs to exfiltrate + information stored in the database used by the SP. + Thanks to Scott Cantor + + -- Ferenc Wágner Mon, 30 Nov 2026 14:41:55 +0100 + shibboleth-sp (3.5.0+dfsg-2+deb13u1) trixie-security; urgency=high * [627cc27] New patch: SSPCPP-1014 - Extend escaping in strings. @@ -5,7 +17,7 @@ specially crafted inputs can exfiltrate information stored in the database used by the SP. The vulnerability is moderate to high severity for anyone using the ODBC plugin, and of no impact for others. - Thanks to Scott Cantor (Closes: #1114506) + Thanks to Scott Cantor (Closes: #1114506, CVE-2025-9943) -- Ferenc Wágner Sat, 06 Sep 2025 11:46:12 +0200 diff -Nru shibboleth-sp-3.5.0+dfsg/debian/patches/Use-bound-parameters.patch shibboleth-sp-3.5.0+dfsg/debian/patches/Use-bound-parameters.patch --- shibboleth-sp-3.5.0+dfsg/debian/patches/Use-bound-parameters.patch 1970-01-01 00:00:00.000000000 +0000 +++ shibboleth-sp-3.5.0+dfsg/debian/patches/Use-bound-parameters.patch 2026-11-30 13:39:59.000000000 +0000 @@ -0,0 +1,181 @@ +From: Scott Cantor +Date: Mon, 30 Nov 2026 08:31:00 -0500 +Subject: Use bound parameters. + +--- + odbc-store/odbc-store.cpp | 74 +++++++++++++++++++++++------------------------ + 1 file changed, 37 insertions(+), 37 deletions(-) + +diff --git a/odbc-store/odbc-store.cpp b/odbc-store/odbc-store.cpp +index aae8520..d675c43 100644 +--- a/odbc-store/odbc-store.cpp ++++ b/odbc-store/odbc-store.cpp +@@ -250,26 +250,25 @@ namespace { + strftime(ret,32,"{ts '%Y-%m-%d %H:%M:%S'}",ptime); + } + +- class SQLString { +- const char* m_src; +- string m_copy; +- public: +- SQLString(const char* src) : m_src(src) { +- if (strchr(src, '\\') || strchr(src, '\'')) { +- m_copy = src; +- replace_all(m_copy, "\\", "\\\\"); +- replace_all(m_copy, "'", "\\'"); +- } ++ SQLRETURN bindAndExecute(SQLHSTMT stmt, const string& q, const char* context, const char* key=nullptr) ++ { ++ SQLLEN ind = SQL_NTS; ++ ++ SQLRETURN sr = SQLPrepare(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ if (SQL_SUCCEEDED(sr)) { ++ sr = SQLBindParam(stmt, 1, SQL_C_CHAR, SQL_VARCHAR, max(strlen(context), 1), 0, const_cast(context), &ind); + } + +- operator const char*() const { +- return tostr(); ++ if (SQL_SUCCEEDED(sr) && key) { ++ sr = SQLBindParam(stmt, 2, SQL_C_CHAR, SQL_VARCHAR, max(strlen(key), 1), 0, const_cast(key), &ind); + } + +- const char* tostr() const { +- return m_copy.empty() ? m_src : m_copy.c_str(); ++ if (SQL_SUCCEEDED(sr)) { ++ sr = SQLExecute(stmt); + } +- }; ++ ++ return sr; ++ } + }; + + ODBCStorageService::ODBCStorageService(const DOMElement* e) : m_log(Category::getInstance("XMLTooling.StorageService")), +@@ -554,8 +553,6 @@ int ODBCStorageService::readRow(const char *table, const char* context, const ch + // Prepare and exectute select statement. + char timebuf[32]; + timestampFromTime(time(nullptr), timebuf); +- SQLString scontext(context); +- SQLString skey(key); + string q("SELECT version"); + if (pexpiration) + q += ",expires"; +@@ -563,11 +560,11 @@ int ODBCStorageService::readRow(const char *table, const char* context, const ch + pvalue->erase(); + q = q + ",CASE version WHEN " + lexical_cast(version) + " THEN null ELSE value END"; + } +- q = q + " FROM " + table + " WHERE context='" + scontext.tostr() + "' AND id='" + skey.tostr() + "' AND expires > " + timebuf; ++ q = q + " FROM " + table + " WHERE context=? AND id=? AND expires > " + timebuf; + if (m_log.isDebugEnabled()) + m_log.debug("SQL: %s", q.c_str()); + +- SQLRETURN sr=SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ SQLRETURN sr = bindAndExecute(stmt, q, context, key); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("error searching for (t=%s, c=%s, k=%s)", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); +@@ -636,14 +633,12 @@ int ODBCStorageService::updateRow(const char *table, const char* context, const + // First, fetch the current version for later, which also ensures the record still exists. + char timebuf[32]; + timestampFromTime(time(nullptr), timebuf); +- SQLString scontext(context); +- SQLString skey(key); + string q("SELECT version FROM "); +- q = q + table + " WHERE context='" + scontext.tostr() + "' AND id='" + skey.tostr() + "' AND expires > " + timebuf; ++ q = q + table + " WHERE context=? AND id=? AND expires > " + timebuf; + + m_log.debug("SQL: %s", q.c_str()); + +- sr = SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ sr = bindAndExecute(stmt, q, context, key); + if (!SQL_SUCCEEDED(sr)) { + m_log.error("error searching for (t=%s, c=%s, k=%s)", table, context, key); + log_error(stmt, SQL_HANDLE_STMT); +@@ -685,7 +680,7 @@ int ODBCStorageService::updateRow(const char *table, const char* context, const + q = q + "expires = " + timebuf; + } + +- q = q + " WHERE context='" + scontext.tostr() + "' AND id='" + skey.tostr() + "'"; ++ q = q + " WHERE context=? AND id=?"; + + sr = SQLPrepare(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if (!SQL_SUCCEEDED(sr)) { +@@ -709,6 +704,16 @@ int ODBCStorageService::updateRow(const char *table, const char* context, const + m_log.debug("SQLBindParam succeeded (value = %s)", value); + } + ++ SQLUSMALLINT pnum = value ? 2 : 1; ++ sr = SQLBindParam(stmt, pnum, SQL_C_CHAR, SQL_VARCHAR, COLSIZE_CONTEXT, 0, const_cast(context), &b_ind); ++ if (SQL_SUCCEEDED(sr)) ++ sr = SQLBindParam(stmt, pnum + 1, SQL_C_CHAR, SQL_VARCHAR, COLSIZE_ID, 0, const_cast(key), &b_ind); ++ if (!SQL_SUCCEEDED(sr)) { ++ m_log.error("SQLBindParam failed (t=%s, c=%s, k=%s)", table, context, key); ++ log_error(stmt, SQL_HANDLE_STMT); ++ throw IOException("ODBC StorageService failed to update record."); ++ } ++ + int attempts = 3; + pair logres; + do { +@@ -740,12 +745,10 @@ bool ODBCStorageService::deleteRow(const char *table, const char *context, const + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and execute delete statement. +- SQLString scontext(context); +- SQLString skey(key); +- string q = string("DELETE FROM ") + table + " WHERE context='" + scontext.tostr() + "' AND id='" + skey.tostr() + "'"; ++ string q = string("DELETE FROM ") + table + " WHERE context=? AND id=?"; + m_log.debug("SQL: %s", q.c_str()); + +- SQLRETURN sr = SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ SQLRETURN sr = bindAndExecute(stmt, q, context, key); + if (sr == SQL_NO_DATA) + return false; + else if (!SQL_SUCCEEDED(sr)) { +@@ -818,12 +821,11 @@ void ODBCStorageService::updateContext(const char *table, const char* context, t + char nowbuf[32]; + timestampFromTime(time(nullptr), nowbuf); + +- SQLString scontext(context); +- string q = string("UPDATE ") + table + " SET expires = " + timebuf + " WHERE context='" + scontext.tostr() + "' AND expires > " + nowbuf; ++ string q = string("UPDATE ") + table + " SET expires = " + timebuf + " WHERE context=? AND expires > " + nowbuf; + + m_log.debug("SQL: %s", q.c_str()); + +- SQLRETURN sr = SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ SQLRETURN sr = bindAndExecute(stmt, q, context); + if ((sr != SQL_NO_DATA) && !SQL_SUCCEEDED(sr)) { + m_log.error("error updating records (t=%s, c=%s)", table, context ? context : "all"); + log_error(stmt, SQL_HANDLE_STMT); +@@ -846,15 +848,14 @@ void ODBCStorageService::reap(const char *table, const char* context) + timestampFromTime(time(nullptr), nowbuf); + string q; + if (context) { +- SQLString scontext(context); +- q = string("DELETE FROM ") + table + " WHERE context='" + scontext.tostr() + "' AND expires <= " + nowbuf; ++ q = string("DELETE FROM ") + table + " WHERE context=? AND expires <= " + nowbuf; + } + else { + q = string("DELETE FROM ") + table + " WHERE expires <= " + nowbuf; + } + m_log.debug("SQL: %s", q.c_str()); + +- SQLRETURN sr = SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ SQLRETURN sr = context ? bindAndExecute(stmt, q, context) : SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); + if ((sr != SQL_NO_DATA) && !SQL_SUCCEEDED(sr)) { + m_log.error("error expiring records (t=%s, c=%s)", table, context ? context : "all"); + log_error(stmt, SQL_HANDLE_STMT); +@@ -873,11 +874,10 @@ void ODBCStorageService::deleteContext(const char *table, const char* context) + SQLHSTMT stmt = getHSTMT(conn); + + // Prepare and execute delete statement. +- SQLString scontext(context); +- string q = string("DELETE FROM ") + table + " WHERE context='" + scontext.tostr() + "'"; ++ string q = string("DELETE FROM ") + table + " WHERE context=?"; + m_log.debug("SQL: %s", q.c_str()); + +- SQLRETURN sr = SQLExecDirect(stmt, (SQLCHAR*)q.c_str(), SQL_NTS); ++ SQLRETURN sr = bindAndExecute(stmt, q, context); + if ((sr != SQL_NO_DATA) && !SQL_SUCCEEDED(sr)) { + m_log.error("error deleting context (t=%s, c=%s)", table, context); + log_error(stmt, SQL_HANDLE_STMT); diff -Nru shibboleth-sp-3.5.0+dfsg/debian/patches/series shibboleth-sp-3.5.0+dfsg/debian/patches/series --- shibboleth-sp-3.5.0+dfsg/debian/patches/series 2025-09-06 09:44:50.000000000 +0000 +++ shibboleth-sp-3.5.0+dfsg/debian/patches/series 2026-11-30 13:39:59.000000000 +0000 @@ -4,3 +4,4 @@ seckeygen-defaults-for-Debian.patch Use-runstatedir-from-future-Autoconf-2.70.patch SSPCPP-1014-Extend-escaping-in-strings.patch +Use-bound-parameters.patch