Skip to main content

Cloud

Protecting InfoPath Browser Form Data

Some of SharePoint’s most robust features stem from the "Forms Server" family of technologies. InfoPath browser-compatible forms, VSTA code, custom workflows, and web services are a powerful combination that can handle almost any data-heavy process.
Perhaps the biggest challenge when deploying a solution built on InfoPath Form Services is securing data. I’ve found the following links useful:
On a recent InfoPath workflow project, I ran into a new challenge:

How can we securely filter access to the raw data contained in an InfoPath form?

As you may know, completed InfoPath forms are saved as unencrypted XML documents by default. Most often, these forms are submitted to a document library where many (or all) users have read access.

That’s a potential security hole, as users can open other users’ documents and access confidential data. This may not seem like a big problem, but it is:

"We can always implement security through custom views and conditional formatting. After all, the document library is set so that users can only view forms rendered in the browser, not through the client. That way, we’ll prevent users from seeing confidential data they shouldn’t."

That’s a natural assumption and we’d be copasetic if that was the whole story. True, by setting a document (or form) library to automatically open InfoPath files in the browser, users won’t be able to manipulate the document on their own hard drive.

However, it’s important to realize that users can always view the raw XML outside of InfoPath. They only need to right-click on an .XML file and select "Save As" in order to view the pure data, including hidden fields. Nothing is encrypted.

"That’s fine. We’ll lock down the document library using item-level permissions so users can only see their own work."

That should work, although it’s not alwayspractical. Setting up and maintaining item-level permissions can be confusing and error-prone. It’s also rigid.

What if users need to able to view portions of each others’ reports? For example, an organization may track service tickets through InfoPath. In that case, users should be able to see all ticket data, except for confidential fields such as passwords. What happens then?

"It’s not InfoPath’s responsibility to protect the data. We should secure our form using Information Rights Management."

I agree that would be the best case scenario, but IRM is not supported in browser-based forms.

"Maybe we can digitally sign the forms?"

We sure can (at least in Internet Explorer), but digital signatures in InfoPath are used for verification, not encryption. They’re great for authentication, not protecting the underlying data.

"Ok. Let’s just write our own encryption code."

That’s certainly an option, but it’s overkill. Advanced developers may be able to write encryption code and decryption code in the Form_Submit and Form_Load event handlers, but that introduces a great deal of complexity and, in turn, new challenges. For starters, how do we distribute keys?

"Well, what do you suggest?"

I’m glad you asked. I suggest we write our own HttpModule to filter XML files from a given document library.

How it works:
  1. An HttpModule listens for all requests within a given path.
  2. A custom method is set to process the BeginRequest event.
  3. Whenever an XML file is requested in that path through IIS, our custom logic filters the request.
  4. The filter either blocks certain users / groups from accessing the XML file altogether or filters out confidential sections of the form.
  5. Filtering can consist of an XSL Transform to omit protected sections or to block all content.
This is all safe because InfoPath Forms Services accesses XML forms directly through the SP object model and thus avoids being filtered by our HttpModule.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Bert Johnson

More from this Author

Follow Us