libIEC61850 Version 1.6.2 Released

MZ Automation has released libIEC61850 version 1.6.2, delivering a substantial collection of security, stability, and protocol-handling improvements.

This release strengthens several core areas of the library, including MMS, TLS, R-Session, Sampled Values, GOOSE, ACSE, ISO session and presentation layers, and COTP. It also introduces new runtime configuration options, additional GOOSE publishing flexibility, and a new .NET dynamic server example.

Expanded TLS Functionality

The TLS integrations for Mbed TLS 2.28 and 3.6 have been improved, including the integration of the latest TLS enhancements developed for lib60870.

IedServer and IedConnection now support updating the TLS configuration while the application is running. Updated configurations apply to newly established connections, allowing certificates and other TLS settings to be changed without requiring the entire application to be restarted.

As part of this change, TLSConfiguration is no longer stored in IsoConnectionParameters, and the obsolete function IsoConnectionParameters_setTlsConfiguration has been removed.

The release also corrects an issue in TLSConfiguration_addCiphersuite that could overwrite the first configured cipher suite when the cipher-suite list was full.

More Flexible GOOSE Publishing

Version 1.6.2 introduces the following new functions:

  • IedServer_enableGoosePublishing
  • IedServer_stopGoosePublishing

These functions allow applications to use the integrated GOOSE publisher without starting the MMS server. This is useful for applications that need GOOSE communication but do not require an active MMS server connection.

The IED server will also now publish updated GOOSE data immediately rather than waiting for the application to call IedServer_unlockDataModel.

Sampled Values Improvements

A new API function, SVReceiver_handleL2Message, allows applications to feed raw Ethernet frames directly into the Sampled Values receiver without using the library’s Ethernet hardware abstraction layer.

This provides additional integration flexibility for applications that already have their own Ethernet frame reception mechanism or require a custom network interface implementation.

Several Sampled Values parsing issues have also been corrected, including missing length validations, out-of-bounds read risks, and a string termination issue affecting svID and datSet values.

Dynamic Server and Model Enhancements

A new .NET dynamic server example has been added. The example demonstrates how to use the library without relying on a statically generated data model or configuration file.

Boolean handling in the Java and .NET Dynamic Model Generators has also been improved. The generators now correctly recognize common Boolean representations such as:

  • true and false
  • 1 and 0

An additional issue affecting the loading of values from DataTypeTemplates has also been fixed.

Improved IED Server Behavior

The IED server now supports write access to Functional Constraint Data objects through the global write access handler.

Support has also been added for configuring request timeouts for the MMS ObtainFile service.

A reporting issue in IedServer_updateAttributeValue has been corrected. Previously, certain Boolean data updates could cause two duplicate-update reports to be generated.

Server-side and GOOSE publisher/subscriber timeout handling has also been changed to use a monotonic clock rather than the system’s real-time clock. This prevents clock adjustments from interfering with timeout calculations.

Optional Testing API

Version 1.6.2 introduces the optional build setting:

LIB61850_ENABLE_TEST_API

This option is disabled by default. When enabled, it exports the test-only function MmsConnection_setFileReadArtificialDelay, which can inject an artificial delay before MMS file read responses.

The functionality is intended for deterministic testing of ObtainFile request timeouts. Standard production builds remain unaffected while the option is disabled.

Security and Robustness Improvements

A major focus of version 1.6.2 is improving the library’s handling of malformed, unexpected, or intentionally manipulated protocol messages.

The release addresses multiple issues that could otherwise result in:

  • Out-of-bounds reads or writes
  • NULL pointer dereferences
  • Stack overflows
  • Heap use-after-free conditions
  • Double-free conditions
  • Invalid memory releases
  • Integer or shift-operation overflows
  • Infinite loops
  • Missing authentication checks
  • Improper message-length validation

The MMS server and client received extensive hardening, including fixes involving alternate access paths, report control blocks, association-specific datasets, MMS file services, malformed LastApplError messages, and variable access specifications.

Additional validation was added throughout the lower communication layers, including ACSE, ISO presentation, ISO session, COTP, and BER decoding.

R-Session Security Improvements

R-Session processing received a significant number of security and stability improvements.

The release adds further message-length validation for version 1 and version 2 messages, prevents payload-length wrap-around, and blocks messages that exceed the configured buffer size.

It also corrects issues involving:

  • Signature verification
  • Unsupported signature algorithms
  • Encryption handling in protocol version 1
  • Oversized configured payload buffers
  • Missing authentication when an unsupported algorithm was selected
  • Random-data memory management

These changes improve the validation of encrypted and authenticated R-Session traffic and ensure that unsupported security configurations are rejected rather than silently accepted.

GOOSE Subscriber Protection

An unbounded recursion issue in the GOOSE subscriber has been fixed. A specially constructed data structure could previously cause the recursive parseAllDataUnknownValue function to exhaust the application stack.

The updated implementation prevents this condition and improves the robustness of GOOSE message processing.

Updating to Version 1.6.2

Because this release contains a large number of security and stability corrections, users are encouraged to review the changes and update their applications where appropriate.

Customers with an active Maintenance and Support plan can obtain the latest commercial release through the MZ Automation customer portal.

The open-source version of libIEC61850 is available through the project’s GitHub repository under the terms of the GNU General Public License version 3.