Hi,
Some DOCX files make Aspose.Words use 100% CPU (making our server unreachable).
This can be reproduced with the latest version of Aspose.Words (22.1.0)
Simply calling the constructor is enough to make this happen:
using Aspose.Words;
using System.IO;
namespace HangTest
{
internal class Program
{
static void Main(string[] args)
{
using (var stream = File.OpenRead("obfuscated.docx"))
{
var document = new Document(stream);
}
}
}
}
The problem is caused by a problem in the DOCX. This should of course never result in a 100% CPU endless loop. MS Word will open de DOCX without problem.
Tip: the problem in the DOCX is a circular reference in ‘word/styles.xml’ (inside the docx)
image.png (15.6 KB)
DOCX that will go wrong:
obfuscated.docx (55.5 KB)
Can you please fix this?