Embedded URL data was found within the application code.
Steps to Reproduce
Inspect source code for the hardcoded URLs shown in the Findings Evidence tables. Evaluating code for common schemes of URL strings and known domains can be helpful in finding uses of hardcoded URLs.
In NowSecure's automated testing, we identify embedded URLs in the source code.
Business Impact
Hardcoded URLs were found in the application's code or resources.
URLs can often contain sensitive information such as access tokens or provide insight on backend resources that a malicious attacker can leverage to exploit the app.
Remediation Resources
Recommended Fix
Do not embed sensitive URLs in your application code or resources. If sensitive URLs need to be configured into an app, they should be retrieved from a backend when possible.
Code Samples
Good Code Example (.swift)
import Obfuscator
// Add SERVER_URL to build settings with key
// Read SERVER_URL
let SERVER_URL = Bundle.main.object(forInfoDictionaryKey: “ServerURL”) as! String
let o = Obfuscator(withSalt: [AppDelegate.self, NSObject.self, NSString.self])
// Generate byte array
let bytes = o.bytesByObfuscatingString(string: SERVER_URL)
// Reveal the string
let url = o.reveal(key: bytes)
Finding Description
Embedded URL data was found within the application code.
Steps to Reproduce
Inspect source code for the hardcoded URLs shown in the Findings Evidence tables. Evaluating code for common schemes of URL strings and known domains can be helpful in finding uses of hardcoded URLs. In NowSecure's automated testing, we identify embedded URLs in the source code.
Business Impact
Hardcoded URLs were found in the application's code or resources. URLs can often contain sensitive information such as access tokens or provide insight on backend resources that a malicious attacker can leverage to exploit the app.
Remediation Resources
Recommended Fix
Do not embed sensitive URLs in your application code or resources. If sensitive URLs need to be configured into an app, they should be retrieved from a backend when possible.
Code Samples
Good Code Example (.swift)
Good Code Example (.objc)
Additional Guidance
Risk and Regulatory Information
Severity: info
Application
See more detail in the NowSecure Report