intesar / NB-Sales

0 stars 0 forks source link

Unsecured on PUT:/api/v1/primary-transaction #1573

Open intesar opened 4 years ago

intesar commented 4 years ago

Title: Unsecured Vulnerability on PUT:/api/v1/primary-transaction Project: NetBanking API Description: The unsecured exploit gives an attacker full access to the vulnerable endpoint without credentials.

Assertion Name: Unsecured Endpoints ( 1 )

Overview: RESTful API is an application program interface (API) that uses HTTP requests to GET, PUT, POST, and DELETE data. A RESTful API — also referred to as a RESTful web service — is based on representational state transfer (REST) technology, an architectural style and approach to communications often used in web services development. These exposed endpoints should not be open to all and should be protected. A top priority for the organizations is to have Secured Endpoints.

The 'Unsecured Endpoint' scanning identifies vulnerabilities resulting from the non-protected endpoints. These endpoints requires no authentication scheme and are open for both authenticated and non-authenticated requests.

Authentication mechanisms are often implemented incorrectly, allowing attackers to compromise authentication tokens or to exploit implementation flaws to assume other user's identities temporarily or permanently. Compromising system's ability to identify the client/user, compromises API security overall.

Security misconfiguration is commonly a result of insecure default configurations, incomplete or ad-hoc configurations, open cloud storage, misconfigured HTTP headers, unnecessary HTTP methods, permissive Cross-Origin resource sharing (CORS), and verbose error messages containing sensitive information.

Severity: The difficulty of achieving API security has increased exponentially and unprotected APIs are one of the top web application security risks organizations face. OWASP included “Unprotected APIs” in its proposal for 2017 top 10 list. ( 2 )

Vulnerability Impact: Every exposed API end-point will have some action to be performed thru appropriate HTTP method and not all methods are valid for every single end-point. Left unchecked and opened for access to all, the following are some of the consequences ( 3 ).


Exploitation: Almost all kinds of authentication, injection, encryption, configuration, access control, and other issues can possible in the RESTful APIs as like the traditional application. Since APIs includes complex data structures and protocols, the security testing may become cumbersome for an attacker. But it is quite possible to analyze APIs and discover vulnerabilities and exploit ( 4 ).

Remediation: The following techniques may be utilized for having Secured Endpoints ( 3 ) ( 5 ) ( 6 ).

References:
  1. Representational State Transfer (REST) - https://en.wikipedia.org/wiki/Representational_state_transfer
  2. OWASP 2017 Top 10 Proposal –Unprotected APIs - https://www.owasp.org/index.php?title=Top_10_2017-A10-Underprotected_APIs&oldid=228947
  3. RESTful API Security - https://dzone.com/articles/restful-api-security
  4. API Exploits - https://www.hack2secure.com/blogs/what-are-api-exploits
  5. REST API Security Guidelines - https://dzone.com/articles/top-5-rest-api-security-guidelines
  6. OWASP REST Security Cheat Sheet - https://www.owasp.org/index.php/REST_Security_Cheat_Sheet

Risk: Unsecured Severity: Critical API Endpoint: http://95.217.118.53:8080/api/v1/primary-transaction Environment: Master Playbook: ApiV1PrimaryTransactionPutAnonymousInvalid Researcher: [apisec Bot] QUICK TIPS Suggestion: Make sure the endpoint is secured as part of the authentication framework. Effort Estimate: 2.0 Wire Logs: 10:16:59 [D] [AVPTPAInvalid] : URL [http://95.217.118.53:8080/api/v1/primary-transaction] 10:16:59 [D] [AVPTPAInvalid] : Method [PUT] 10:16:59 [D] [AVPTPAInvalid] : Auth [] 10:16:59 [D] [AVPTPAInvalid] : Request [{ "amount" : "0256", "availableBalance" : "255474476", "createdBy" : "", "createdDate" : "", "description" : "IaphGfdn", "id" : "", "inactive" : false, "modifiedBy" : "", "modifiedDate" : "", "status" : "IaphGfdn", "type" : "IaphGfdn", "user" : { "createdBy" : "", "createdDate" : "", "id" : "", "inactive" : false, "modifiedBy" : "", "modifiedDate" : "", "name" : "IaphGfdn", "version" : "" }, "version" : "" }] 10:16:59 [D] [AVPTPAInvalid] : Request-Headers [{Accept=[application/json], Content-Type=[application/json]}] 10:16:59 [D] [AVPTPAInvalid] : Response [{ "requestId" : "None", "requestTime" : "2020-09-15T22:16:59.447+0000", "errors" : true, "messages" : [ { "type" : "ERROR", "key" : "", "value" : null } ], "data" : null, "totalPages" : 0, "totalElements" : 0 }] 10:16:59 [D] [AVPTPAInvalid] : Response-Headers [{X-Content-Type-Options=[nosniff], X-XSS-Protection=[1; mode=block], Cache-Control=[no-cache, no-store, max-age=0, must-revalidate], Pragma=[no-cache], Expires=[0], X-Frame-Options=[DENY], Content-Type=[application/json;charset=UTF-8], Transfer-Encoding=[chunked], Date=[Tue, 15 Sep 2020 22:16:58 GMT]}] 10:16:59 [D] [AVPTPAInvalid] : StatusCode [200] 10:16:59 [D] [AVPTPAInvalid] : Time [380] 10:16:59 [D] [AVPTPAInvalid] : Size [176] 10:16:59 [E] [AVPTPAInvalid] : Assertion [@StatusCode == 401 OR @StatusCode == 403] resolved-to [200 == 401 OR 200 == 403] result [Failed] IMPORTANT LINKS Vulnerability Details: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/recommendations/8a8084a0748c80b3017493d7c1f27f08/details Project: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/jobs Environment: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/environments/8a8081766fc3e2a1016fc421d7155a15/edit Scan Dashboard: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/jobs/8a8081766fc3e2a1016fc4230f426628/runs/8a8084a0748c80b3017493d780287ead Playbook: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/template/ApiV1PrimaryTransactionPutAnonymousInvalid Coverage: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/configuration Code Sample: https://cloud.fxlabs.io/#/app/projects/8a8081766fc3e2a1016fc421d6e55a13/recommendations/8a8084a0748c80b3017493d7c1f27f08/codesamples PS: Please contact support@apisec.ai for apisec access and login issues. --- apisec Bot ---