EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Verifying/decrypting random data

Also by EldoS: Rethync
The cross-platform framework that simplifies synchronizing data between mobile and desktop applications and servers and cloud storages
#987
Posted: 08/09/2006 17:16:44
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155

Hi!,

I've found a big bug... if i try to verfy o decrypt this file that i've attached, my application hangs (using SBB 5 beta but with 4 it also happens).

Verifying, it hangs in issignaturedetached, and on decrypt, at decrypt function.

The error is the same, and is at:
function TElASN1Parser.DecodeField(InvokeCallBack: boolean {$ifdef HAS_DEF_PARAMS}= true{$endif}): integer;

It is always returning 2 with this file, and it gets into an infinite loop on:

procedure TElASN1Parser.Parse;
begin
while DecodeField(true) >= 0 do;
end;

The file is a signed file, but BASE64 codified; it was just a dummy test, and i felt really bad having this endless loop. I supposed that if the file wasn't a correct file, the components should exit with a error value, and nothing else.

Please, have a look... although my users won't do this, we've feeled very bad with this bug. It shows many bugs that may be hidden.

If you need anything else, here i am


[ Download ]
#988
Posted: 08/09/2006 23:37:00
by Ken Ivanov (EldoS Corp.)

Thank you for letting us know about it. We will try to reproduce the issue and answer you as soon as possible.
#989
Posted: 08/09/2006 23:46:29
by Ken Ivanov (EldoS Corp.)

The document you provided is stored in Base64-armoured unicode file. Since ElMessageVerifier works only with binary ASN.1 data, it will not provide correct results for such kind of files.

Please find attached the decoded version of the signature, it is verified fine for us.


[ Download ]
#990
Posted: 08/10/2006 00:30:50
by Eugene Mayevski (EldoS Corp.)

I would also say, that there exists a format, and BASE64 encoding is NOT conformant to the format. In other words, it's junk, which we should not even attempt to decode.


Sincerely yours
Eugene Mayevski
#995
Posted: 08/10/2006 03:20:54
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155

I may have not explained well... but i think that Eugene is saying it.

I know that it's in BASE64, i know that it should be in binary form. But the bug, is that instead of returning SB_MESSAGE_ERROR_NO_ENCRYPTED_DATA,SB_MESSAGE_ERROR_INVALID_FORMAT, ... it gets into an endless loop.

Are you saying that if a "hacker" sends my users a "base64 signed file" as this, they'll get a total hang of the program?

I suppose that the error message codes are there for a reason ;).

If you know a routine that could be used to pre-check if the file is in a correct form, then OK. But I think that this could be used for example to execute arbitrary code with this "junk" file.

Have i explained better?
#996
Posted: 08/10/2006 03:40:48
by Ken Ivanov (EldoS Corp.)

Actually, the parsing does not hang. Due to its structure, ASCII Unicode file is a valid ASN.1 sequence (it's a very long sequence of zero-length tags). That's why its processing takes a lot of time. So you will get an error result, but only after the signature is processed.

We will consider implementing some workaround for this.
#997
Posted: 08/10/2006 03:53:14
by Santiago Castaño (Standard support level)
Joined: 04/16/2006
Posts: 155

Let me say that i'm not sure of that...

On my AMD X2 4400 system with 2 Gb RAM (I think it's a fast system); I leave it running for a while... and the result are really bad:
- 1 processor (the one running the thread, is at 100% load)
- The memory use is 1 GB!!... really a high use for a 1Kb file :D

The process of verification has eaten 10 minutes use processor time; and it didn't stop; so i killed it.

I'll wait for that workaround...
#998
Posted: 08/10/2006 04:19:20
by Ken Ivanov (EldoS Corp.)

I have added the problem to the bugtracker. It will be fixed in SecureBlackbox 5 release.
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 4288 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!