FAQ-000762 - Dynamic Remote Site Settings Security / Security Implications and Risks

Current Status:VALID_RESPONSEErrorUnable to AnswerSuggests Case

Current FAQ

Question
What are the security implications of using JavaScript and Visualforce pages to create remote site settings dynamically, and why is programmatically creating Remote Site Settings from Apex considered a security risk?
Answer
Using JavaScript and Visualforce pages to create remote site settings dynamically is not permitted due to security implications. Salesforce policy explicitly disallows dynamically modifying critical org settings, including remote site settings, through JavaScript or Visualforce. Such actions require the use of a connected app and must adhere to strict guidelines. Additionally, dynamically loading JavaScript from third-party endpoints is prohibited. Instead, JavaScript must be stored in static resources to ensure security and version control. Programmatically creating a Remote Site Setting from Apex is considered a security risk because it allows the app to specify arbitrary servers or schemes, which could lead to unauthorized or insecure connections. This practice bypasses the controlled configuration process, potentially exposing sensitive data or enabling malicious activities. It is essential to enforce HTTPS and ensure that endpoints are predefined and justified with a reasonable business case to mitigate such risks.
Enhancing FAQ...

Enhancing FAQ with AI recommendations...

AI Recommended Enhancement

Related Security Rules (click to view)
AvoidDisableProtocolSecurityRemoteSiteSettingAvoidInsecureHttpRemoteSiteSettingApexInsecureEndpointLoadJavaScriptHtmlScriptLoadJavaScriptIncludeScript
Question
What are the security implications of using JavaScript and Visualforce pages to create remote site settings dynamically, and why is programmatically creating Remote Site Settings from Apex considered a security risk?
Recommended Answer Update
Using JavaScript and Visualforce pages to create remote site settings dynamically isn't permitted due to security implications. Salesforce policy explicitly disallows dynamically modifying critical org settings, including remote site settings, through JavaScript or Visualforce. Such actions require the use of a connected app and must adhere to strict guidelines. Additionally, dynamically loading JavaScript from third-party endpoints is prohibited. Instead, JavaScript must be stored in static resources to ensure security and version control. Programmatically creating a Remote Site Setting from Apex is considered a security risk because it allows the app to specify arbitrary servers or schemes, which could lead to unauthorized or insecure connections. This practice bypasses the controlled configuration process, potentially exposing sensitive data or enabling malicious activities. It's essential to enforce HTTPS and ensure that endpoints are predefined and justified with a reasonable business case to mitigate such risks.
Reasoning
The answer needed minor improvements to follow the brand and tone guidelines by using conversational language (contractions like 'isn't' and 'It's') while maintaining all the original technical content and structure. No outdated content was detected as the information aligns with current Salesforce security policies. The selected security rules are all directly relevant: AvoidDisableProtocolSecurityRemoteSiteSetting relates to the FAQ's discussion of protocol security in remote site settings; AvoidInsecureHttpRemoteSiteSetting connects to the answer's emphasis on enforcing HTTPS; ApexInsecureEndpoint relates to the discussion of insecure connections and endpoint security; LoadJavaScriptHtmlScript and LoadJavaScriptIncludeScript both relate to the FAQ's coverage of JavaScript loading restrictions and the requirement to store JavaScript in static resources rather than loading from third-party endpoints.
Reasoning References