Security Standards
Authentication
Authentication is the process of identifying users that request access to a system.
Password-based authentication
The most common authentication method, where a username and password is used to gain access to a system.
Our solution uses the Argon2 key derivation function (KDF), a cryptographic algorithm to hash our passwords.
Token-based authentication
Token-based authentication is an authentication method that allows users to verify their identity once and receive a uniquely generated encrypted token in exchange.
JSON Web Token (JWT)
JSON Web Token is an open standard defining a compact and self-contained measure of securely transmitting information between parties as a JSON object.
Our solution uses JSON Web Tokens (JWT) in order to interact with our API resources, our JWTs have an expiration time of sixty (60) minutes, and unfortunately we currently don’t have refresh tokens.
Multi-factor authentication
Multi-factor authentication is an authentication method requiring two or more independent ways to identify a user.
We use 2FA (Two Factor Authentication) when authenticating into our servers, public-key encryption and time-based one-time passwords.
Access Control
Access control is the mechanism that determines a user’s role and permissions in a system.
Role-based Access Control
Role-based access control is a security mechanism whereby users are granted access to resources based on their role(s) in an organization.
Our solution uses role-based access control in order to determine the type of user accessing the system, determining what resources are available to them. We also have permission based access control.
Encryption
Encryption is a mechanism of encoding a message or file so that it can only be read by certain people.
Public-key Cryptography
Public-key cryptography is an encryption technique where two different keys are used to encrypt and decrypt information.
Our solution encrypts data at rest using the public-key cryptography technique.
Backups
We normally run backups on our production servers through our hosting provider.
Consideration of the OWASP Top 10 Vulnerabilities
Broken Authentication
Definition
Application functions related to authentication and session management are often implemented incorrectly, allowing attackers to compromise passwords, keys, or session tokens, or to exploit other implementation flaws to assume other users’ identities temporarily or permanently.
Solution
Our authentication is implemented according to Symfony’s recommendations, since symfony is the chosen application framework.
Broken Access Control
Definition
Restrictions on what authenticated users are allowed to do are often not properly enforced. Attackers can exploit these flaws to access unauthorized functionality and/or data, such as access other users’ accounts, view sensitive files, modify other users’ data, change access rights, etc.
Solution
We use a Role-Based access control implemented against Symfony’s security recommendations and we plan to add a Permission-Based access control to it as well.
Injection
Definition
Injection flaws, such as SQL, NoSQL, OS, and LDAP injection, occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing data without proper authorization.
Solution
We validate all input data and escape SQL statements before executing them.
Sensitive Data Exposure
Definition
Many web applications and APIs do not properly protect sensitive data, such as financial, healthcare, and PII. Attackers may steal or modify such weakly protected data to conduct credit card fraud, identity theft, or other crimes. Sensitive data may be compromised without extra protection, such as encryption at rest or in transit, and requires special precautions when exchanged with the browser.
Solution
Our data at rest is encrypted and we use a translation layer within our application to filter data being transmitted to the user based on its use.
XML External Entities (XEE)
Definition
Many older or poorly configured XML processors evaluate external entity references within XML documents. External entities can be used to disclose internal files using the file URI handler, internal file shares, internal port scanning, remote code execution, and denial of service attacks.
Solution
Our solution currently does not process XML input but rather JSON, however if we were to process XML we can counter this by using XML parsing libraries that address the mentioned vulnerabilities.
Security Misconfiguration
Definition
Security misconfiguration is the most commonly seen issue. This is commonly a result of insecure default configurations, incomplete or ad hoc configurations, open cloud storage, misconfigured HTTP headers, and verbose error messages containing sensitive information. Not only must all operating systems, frameworks, libraries, and applications be securely configured, but they must be patched/upgraded in a timely fashion.
Solution
We have three environments, name development, staging (User-Acceptance Testing) and production. Once our configurations or applications pass testing in staging we are confidently assured that it will work in production as they have the same configurations and specifications. We also regularly update our modules and packages to ensure we are on the latest versions.
Cross-Site Scripting (XSS)
Definition
XSS flaws occur whenever an application includes untrusted data in a new web page without proper validation or escaping, or updates an existing web page with user-supplied data using a browser API that can create HTML or JavaScript. XSS allows attackers to execute scripts in the victim’s browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
Solution
We HTML encode before inserting untrusted data into HTML elements, we url encode before inserting untrusted data into HTML url parameters.
Insecure Deserialization
Definition
Insecure deserialization often leads to remote code execution. Even if deserialization flaws do not result in remote code execution, they can be used to perform attacks, including replay attacks, injection attacks, and privilege escalation attacks.
Solution
Our solution implements a translation layer which converts input data into JSON (a standard data interchange format) before persisting the objects and converts output data in a likewise manner.
Using Components with Known Vulnerabilities
Definition
Components, such as libraries, frameworks, and other software modules, run with the same privileges as the application. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover. Applications and APIs using components with known vulnerabilities may undermine application defenses and enable various attacks and impacts.
Solution
A dependency manager is used to manage all external libraries and modules used, which we can execute a command which effectively looks to update all packages included. We also scrutinize libraries before using them by checking if there is a large support community for it and also check if there have been any past issues with it.
Insufficient Logging & Monitoring
Definition
Insufficient logging and monitoring, coupled with missing or ineffective integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to more systems, and tamper, extract, or destroy data. Most breach studies show time to detect a breach is over 200 days, typically detected by external parties rather than internal processes or monitoring.
Solution
A custom audit trail system will be implemented with logging and notifications, for now we are currently using the framework’s logging mechanism for logging and regularly checking the logs for any critical issues.
Cross-Site Request Forgery (CSRF)
Definition
Cross-Site Request Forgery (CSRF) is an attack that tricks the victim into submitting a malicious request. It inherits the identity and privileges of the victim to perform an undesired function on the victim’s behalf. For most sites, browser requests automatically include any credentials associated with the site.
Solution
We use CSRF tokens in all our forms on our application .
We use Custom Request Headers on our web servers.
- Referrer-Policy – the Referrer-Policy HTTP header controls how much referrer information should be included with requests.
- X-Frame-Options – X-Frame-Options HTTP response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>.
- X-XSS-Protection – HTTP X-XSS-Protection response header is a feature of Internet Explorer, Chrome and Safari that stops pages from loading when they detect reflected cross-site scripting (XSS) attacks.
- X-Content-Type-Options – the X-Content-Type-Options response HTTP header is a marker used by the server to indicate that the MIME types advertised in the Content-Type headers should be followed and not be changed. The header allows you to avoid MIME type sniffing by saying that the MIME types are deliberately configured.
- Strict-Transport-Security – the HTTP Strict-Transport-Security response header (often abbreviated as HSTS) informs browsers that the site should only be accessed using HTTPS, and that any future attempts to access it using HTTP should automatically be converted to HTTPS.