Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for reading and writing zero-length OctetStrings #372

Open
justinstenning opened this issue Dec 4, 2024 · 1 comment
Open

Support for reading and writing zero-length OctetStrings #372

justinstenning opened this issue Dec 4, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@justinstenning
Copy link

We will be working on a migration from OpenDNP3 to stepfunc/dnp3 C# bindings soon. One of the customisations we had to make within OpenDNP3 was support for reading and writing OctetStrings, including zero-length ones.

We understand that zero-length OctetStrings is probably a non-standard implementation, so perhaps this could live behind some kind of enableNonStandardFeatures flag?

As discussed previously, our team are happy to help with implementation and can assist with testing C# bindings if required.

@jadamcrain
Copy link
Member

I think that writing them could always be allowed in the master. There's a security issue with reading them. The encoding for a zero-length string is nothing but a header, e.g. you can say "this packets contains group 110 variation 0 start: 0 stop: 65535" and it only takes ~5 bytes to encode 65K values.... repeat this to fill an ASDU and it's like a ZIP bomb if the master makes a callback for each value:

https://www.cisa.gov/news-events/ics-advisories/icsa-14-149-01

It was kinda vague in the spec before I pointed out how problematic this is, then the committee "clarified" that 0-length strings weren't allowed b/c variation had always been reserved for requests to mean "send whatever your default variation is".

All of that said, I just think we need a configuration option to enable parsing 0-length strings on the master, and we can always allow writing them.

@jadamcrain jadamcrain added this to the 1.7.0 milestone Dec 9, 2024
@jadamcrain jadamcrain added the enhancement New feature or request label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants