We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Cells wrongly claimed the version is cracked with 19.4.0

Hi,

We noticed some random file corruptions in the output when using Aspose.Cells 19.4.0. After checking the xml file inside, we noticed Aspose purposely corrupted the document because it thought the version I was using is cracked:

image.png (46.9 KB)

However, I have been using the legit Aspose.Total licence and have purchased new license every year, and I have never attempted to use a cracked version.

To replicate the issue, I used the following code:

// Register Aspose first
var files = new[]
{
@“C:\1.xlsx”,
@“C:\2.xlsx”,
@“C:\3.xlsx”
};
Parallel.ForEach(files, (f) => { var workbook = new Workbook(f);
workbook.Save(f);
});

I’m using .net framework 4.5.2, Aspose.Cells 19.4.0, license is Aspose.Total. I have attached the files for your reference.

test.zip (27.9 KB)

It does not happen all the time, but after a few attempts, you can see one of the output files is purposely corrupted with the message in the XML in my screenshot above. You can replicate the issue by keeping running the code above.

This is quite a serious issue as Aspose wrongly deemed the version is cracked, and corrupted the file silently, even if we have purchased the license from Aspose.

Moreover, I noticed the issue did not happen (in my tests) in 19.5.0 and above, but I did not find any explanation on the release note.

It is very concerning to me, could you please help to check why it happened, and confirm whether it has been officially fixed in 19.5.0 or later versions?

UPDATE: I tested previous versions as well and found the issue only started appearing from 19.2.0, before 19.1.0 it also seemed to work fine. Could you give us a bit more clarification on what happened in 19.2.0-19.4.0?

Thanks,

@ServerSide527,
I have tried this scenario by automating the whole process and executed it thousands of time to reproduce this scenario but could not succeed. I set the target .NET framework to 4.5.2 and tried with Aspose.Cells for .NET 19.4 and latest version 19.10.6. I created a test folder and placed your test.zip file there (which contains the sample XLSX files). Also I used Windows 7 and valid license for testing.

This code performs the following tasks multiple times (say 1000 times):

  1. Delete all the files and folders in this test folder except test.zip file

  2. Extract the zip file test.zip which generates 3 template files

  3. Here your sample code is executed which opens and saves template files in parallel.

  4. Change extension of all the XLSX files to .ZIP

  5. Extract contents from each zip file to respective folder like 1, 2 and 3.

  6. Search each folder to find the string You are using cracked version and display if found.

I am afraid that no issue is reproduced and programs runs fine.

Please give it a try and share the feedback along with the steps to reproduce this issue here.

P.S. This code can be simplified more but it is just a sample code to reproduce the issue.

static void Main(string[] args)
{
	Aspose.Cells.License lic1 = new Aspose.Cells.License();
	lic1.SetLicense(@"Aspose.Total.Product.Family.lic");
	Console.WriteLine("Aspose.Cells for .NET v" + CellsHelper.GetVersion());
	for (int i = 0; i < 1000; i++)
	{
		Console.WriteLine(i);
		Cells_205119();
	}
	Console.WriteLine("Task Finished. Press any key to continue...");
	Console.ReadKey();
}

    static void Cells_205119()
    {
        string path = @"C:\test\";
        if (File.Exists(path + "1.xlsx"))
            File.Delete(path + "1.xlsx");
        if (File.Exists(path + "2.xlsx"))
            File.Delete(path + "2.xlsx");
        if (File.Exists(path + "3.xlsx"))
            File.Delete(path + "3.xlsx");


        if (File.Exists(path + "1.zip"))
            File.Delete(path + "1.zip");
        if (File.Exists(path + "2.zip"))
            File.Delete(path + "2.zip");
        if (File.Exists(path + "3.zip"))
            File.Delete(path + "3.zip");

        if (Directory.Exists(path + "1"))
            Directory.Delete(path + "1", true);

        if (Directory.Exists(path + "2"))
            Directory.Delete(path + "2",true);

        if (Directory.Exists(path + "3"))
            Directory.Delete(path + "3",true);
        System.IO.Compression.ZipFile.ExtractToDirectory(path + "test.zip", path);
        var files = new[]
        {
            path + "1.xlsx",
            path + "2.xlsx",
            path + "3.xlsx"
        };
    Parallel.ForEach(files, (f) => { var workbook = new Workbook(f);
    workbook.Save(f);
    });
        File.Move(path + "1.xlsx", Path.ChangeExtension(path + "1.xlsx", ".zip"));
        File.Move(path + "2.xlsx", Path.ChangeExtension(path + "2.xlsx", ".zip"));
        File.Move(path + "3.xlsx", Path.ChangeExtension(path + "3.xlsx", ".zip"));

        //System.IO.Compression.ZipFile.CreateFromDirectory(startPath, zipPath);
        System.IO.Compression.ZipFile.ExtractToDirectory(path + "1.zip", path + "1\\");
        System.IO.Compression.ZipFile.ExtractToDirectory(path + "2.zip", path + "2\\");
        System.IO.Compression.ZipFile.ExtractToDirectory(path + "3.zip", path + "3\\");
                
        SearchStringInFolder(path + "1\\xl\\workbook.xml");
        SearchStringInFolder(path + "2\\xl\\workbook.xml");
        SearchStringInFolder(path + "3\\xl\\workbook.xml");
    }
    static void SearchStringInFolder(string file)
    {
        string[] lines = File.ReadAllLines(file);
        string firstOccurrence = lines.FirstOrDefault(l => l.Contains("You are using cracked version."));
        if (firstOccurrence != null)
        {
            Console.WriteLine("Text found");
        }
    }

Hi,

Thanks for your reply.

I could still easily reproduce the issue here. Could you try the following code:

for (int i = 0; i < 1000; i++)
{
var files = new[]
{
@“C:\1.xlsx”,
@“C:\2.xlsx”,
@“C:\3.xlsx”
};
Parallel.ForEach(files, (f) => { var workbook = new Workbook(f);
workbook.Save(f);
});
}

This will keep loading and saving the file to the same path. In my test, with any versions between 19.2.0 and 19.4.0, it failed at some point because one of the files is corrupted (with the corrupted cracked message written by Aspose) and cannot be loaded again.

Please also note I had to register Aspose licence first otherwise I will just have the evaluation message in the output, but the file won’t be corrupted and it won’t say it is a cracked version.

I’m using Windows 10, .Net Framework 4.5.2, Visual Studio 2017, ‘Any CPU’ build config. It happened in both debug and release build. My Aspose versions are installed from nuget in Visual Studio.

Thanks,

Hi,

Just another update following the code you provided.

I have run the code and still reproduced the issue, please see my screenshot with the result:

image.png (4.8 KB)

I ran your code multiple times, and seemed always only the 1st iteration (after ‘0’ was printed) in the loop had the issue.

Thanks,

@ServerSide527,
We have investigated it more, some additional License checks were added since 19.2 version. But there was a bug in multiple threads. We fixed it in 19.5 so it is not occurring since then. Please upgrade to latest version.

@ahsaniqbalsidiqui thanks for your explanation.

Yes I did notice the issue wasn’t reproducible since 19.5.0 but I did not find anything mentioned in the release note, which was my main concern that the issue could happen again.

Since you have confirmed it was an issue which was fixed in that version, it should be fine now.

Thanks,

@ServerSide527,

Well, since it was a bug in internal licensing module, so we did fix it in the APIs. Also, we did not explicitly announce it in the release notes for the issue could only occur in rare cases.

Anyways, we are happy that you have understand and confirmed.

@Amjad_Sahi thank you. We should be able to communicate and upgrade the version so the issue is resolved.

Hopefully this will not happen again, since Aspose is corrupting the document purposely (and silently) it needs to be accurate on determining whether a version is legit.

You can imagine how bad the situation will be if one of our clients found a document was corrupted for this reason and mistakenly thought we are using an illegal software.

Regards,

@ServerSide527,

We understand your situation and we are sorry for any inconvenience caused to you. It was a bug of checking license and we fixed it from v19.5. We think it is quite reasonable for you to complain it.

We will be more careful when changing any logic for license verification. As in software industry, no matter how careful we are when changing one function, we cannot 100% ensure that all possible scenarios are covered/considered. But one thing we can do is try to evaluate and test as many scenarios/cases as we could, so this could minimize the chance to happen it again. We will try our best to avoid suck kind of issue to occur.

Thanks for your understanding and again we are sorry for this issue.

Thank you. Could you also confirm if it is only an issue in Aspose.Cells or does it also affect other modules (Aspose.Words, Aspose.Slides)?

I don’t know to reproduce such issue on my end with those modules but I have concern whether the issue could possibly exist in those versions.

@ServerSide527,

Yes, this was an internal bug in Aspose.Cells APIs only, so it may not affect other APIs.