I need to accept resume content as a text and process the content. Before processing I thought of using ESAPI.validator().isValidInput to validate the resume content to confirm it doesn't contain malicious code. One of the parameters for isValidInput is regex expression to be validated against the input. Please help me to write a regex for resume content.

有帮助吗?

解决方案

You could try demanding the upload to be in a specific file format e.g .txt .

A regex for this could be: \w:\\(.+\\)*?(.+\.txt)

I say .txt as a plain text file should be less likely to have embedded malicious code. Searching the actually text of a file isn't really your problem, an attack is more likely to come from a simultaneous upload.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top