Just checking to make sure this is "Expected Behavior" and if anyone else is seeing this.

  1. Find any object you have that has encrypted fields.
  2. Ensure you do not have view encrypted information
  3. Create a VF Page with the following

    <apex:page standardController="YOUROBJECT">
         <apex:outPutField value="{!YOUROBJECT.yourencryptedfield}"/>

The first one will display the unmasked data The second using output field will properly mask.

Is this expected?

Seems I am on a case kick so will update as soon as I hear back. See LaceySnr's answer for some important points to remember


FYI - that is 'fixed' in Winter 15 (API 32) - just tested it and it returns a masked output for both examples

Re Release Docs:

For Visualforce pages set to API version 32.0 or later, expressions that reference encrypted sObject fields return the encrypted values instead of the decrypted (plain) values. This behavior more closely matches your expectations and reduces the risk of inadvertent exposure of sensitive data due to programmer error.

  • Would this mean that if you try to output an encrypted field value from a Lightning component such as <aura:outputText> that data masking would not yet be supported for that? Feb 19 '16 at 18:31

From a security point of view I'd be happier if the former was still encrypted but I suspect it's by design given that field level security etc. are not enforced if you use things like <apex:inputText> instead of <apex:inputField>.

I know using the {!object.field} directly would fail security review, so I suppose the takeaway here is to to make sure that best practices are always followed during development, and if you're installing 3rd party packages to only get them from the AppExchange or do some independent verification on them.

  • 1
    I would agree, but it seems lately there are several "vulnerabilities" related to this important field type. There even seems to be issues in debug logs as well (I have seen encrypted password displayed). If it is important enough to be encrypted one would think that you could not bypass it so easily. Thank you for your answer / comments as they are very important to keep in mind. I still wonder if it is a bug or a behaves as expected kinda thing....
    – Eric
    Sep 25 '14 at 2:02
  • Yeah, we could do with some input from Salesforce's internal devs!
    – Matt Lacey
    Sep 25 '14 at 2:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.