<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Bug / SQL injection? Monitoring Windows Event Logs and NetXMS Server SQL errors]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I have configured monitoring Windows Event Logs, I do log message description (%m).</p>
<p dir="auto">However, my NetXMS server started throwing events SYS_DB_QUERY_FAILED [52]<br />
Example of  Event Message:</p>
<pre><code>Database query failed (Query: INSERT INTO alarm_events (alarm_id,event_id,event_code,event_name,severity,source_object_id,event_timestamp,message) VALUES (?,?,?,?,?,?,?,?); Error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__alarm_ev__E6249E6BFEDA1E4D'. Cannot insert duplicate key in object 'dbo.alarm_events'. The duplicate key value is (1704, 64513).)
AlarmText: Database query failed (Query: INSERT INTO alarm_events (alarm_id,event_id,event_code,event_name,severity,source_object_id,event_timestamp,message) VALUES (?,?,?,?,?,?,?,?); Error: [Microsoft][SQL Server Native Client 10.0][SQL Server]Violation of PRIMARY KEY constraint 'PK__alarm_ev__E6249E6BFEDA1E4D'. Cannot insert duplicate key in object 'dbo.alarm_events'. The duplicate key value is (1704, 64513).) Custom message:
UserTag:
</code></pre>
<p dir="auto">I believe that is due to my initial error message which has ' sign. So this is SQL injection to NetXMS alarm_events table.</p>
<p dir="auto"><strong>So this is a huge bug and big security risk for all NetXMS users.</strong><br />
I belive this should be fixed ASAP.</p>
<p dir="auto">Also, please correct me if I am wrong...</p>
]]></description><link>https://forum.netxms.org/topic/3151/bug-sql-injection-monitoring-windows-event-logs-and-netxms-server-sql-errors</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:48:32 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/3151.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 May 2014 12:32:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bug / SQL injection? Monitoring Windows Event Logs and NetXMS Server SQL errors on Thu, 08 May 2014 13:54:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/victor" aria-label="Profile: victor">@<bdi>victor</bdi></a> said in <a href="/post/13841">Bug / SQL injection? Monitoring Windows Event Logs and NetXMS Server SQL errors</a>:</p>
<blockquote>
<p dir="auto">No, it's not due to apostrophe character and SQL injection is not possible here. You can see that SQL statement is a prepared statement with placeholders - it is not constructed dynamically from external data. Also, error message clearly states "Violation of PRIMARY KEY constraint 'PK__alarm_ev__E6249E6BFEDA1E4D'. Cannot insert duplicate key in object 'dbo.alarm_events'. The duplicate key value is (1704, 64513)" - actual problem is that system for some reason tries to insert duplicate record into table. It is definitely a bug, but not a security threat.</p>
<p dir="auto">Best regards,<br />
Victor</p>
</blockquote>
<p dir="auto">Thank you for fast and correct response.<br />
Now I understand this is NOT SQL injection / security hole.</p>
<p dir="auto">Sometimes I also have: "String or binary data would be truncated", but there is lot of duplicate items.</p>
<p dir="auto">Something maybe about wrong collecting windows event logs on a agent/client maybe or event processing rules <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f615.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--confused" style="height:1.4em;width:auto;vertical-align:middle" title=":/" alt="😕" /></p>
<p dir="auto">I do have latest available stable version.</p>
]]></description><link>https://forum.netxms.org/post/13844</link><guid isPermaLink="true">https://forum.netxms.org/post/13844</guid><dc:creator><![CDATA[hkusulja]]></dc:creator><pubDate>Thu, 08 May 2014 13:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to Bug / SQL injection? Monitoring Windows Event Logs and NetXMS Server SQL errors on Thu, 08 May 2014 13:47:16 GMT]]></title><description><![CDATA[<p dir="auto">No, it's not due to apostrophe character and SQL injection is not possible here. You can see that SQL statement is a prepared statement with placeholders - it is not constructed dynamically from external data. Also, error message clearly states "Violation of PRIMARY KEY constraint 'PK__alarm_ev__E6249E6BFEDA1E4D'. Cannot insert duplicate key in object 'dbo.alarm_events'. The duplicate key value is (1704, 64513)" - actual problem is that system for some reason tries to insert duplicate record into table. It is definitely a bug, but not a security threat.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/13841</link><guid isPermaLink="true">https://forum.netxms.org/post/13841</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 08 May 2014 13:47:16 GMT</pubDate></item></channel></rss>