Vulnerabilities in pkg:golang/github.com/huandu/facebook/v2

PACKAGE
Advisory Identifier: GHSA-3f65-m234-9mxr
Advisory Summary

CVE-2024-35232 is a LOW (CVSS 3.7) github.com/huandu/facebook may expose access_token vulnerability (CWE-209: Generation of Error Message Containing Sensitive Information) affecting Github.com/huandu/facebook/v2 libraries in the Go ecosystem. The issue involves github.com/huandu/facebook may expose access_token in error message.. Remediation is available by upgrading affected packages to version 2.7.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/huandu/facebook/v2

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/huandu/facebook/v2. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-3f65-m234-9mxr CVE-2024-35232 LOW github.com/huandu/facebook may expose access_token in error message.

CVE-2024-35232 at a Glance

CVE Identifier CVE-2024-35232
GHSA Identifier GHSA-3f65-m234-9mxr
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-209: Generation of Error Message Containing Sensitive Information
Affected Product Github.com/huandu/facebook/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-35232

To remediate this vulnerability, upgrade all affected Github.com/huandu/facebook/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/huandu/facebook/v2 fixed: 2.7.2
Upgrade github.com/huandu/facebook/v2 to 2.7.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/huandu/facebook/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-35232, inspect your project dependencies for Github.com/huandu/facebook/v2:

inspect dependencies for github.com/huandu/facebook/v2

Analyze the terminal output to locate any version of Github.com/huandu/facebook/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-209: Generation of Error Message Containing Sensitive Information, where the product generates an error message that includes sensitive information about its environment, users, or associated data. In Github.com/huandu/facebook/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary access_token can be exposed in error message on fail in HTTP request. ### Details Using this module, when HTTP request fails, error message can contain access_token. This can be happen when: - module is sending HTTP request with query parameter `?access_token=...`. - and HTTP request fails (errors like `facebook: cannot reach facebook server`). In such situation, error message is constucted like following. https://github.com/huandu/facebook/blob/1591be276561bbdb019c0279f1d33cb18a650e1b/session.go#L558-L567 Original error message contained in it comes from `net/http` module. And it can contain full URL, that can contain query parameter `access_token`: https://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/http/client.go;l=629-633 https://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/url/url.go;l=30 It should be very common that applications log error message when they encounter errors. As a result, access_token can be stored into log server and some other infrastructures. Of course other careless error handling in client code that causing other security problems can exist. I'm not very sure that whether we can consider that github.com/huandu/facebook is vulnerable. Anyway, I think current error message, that can expose access_token, is not desirble. ### PoC Request me this section if you need complete instruction. ### Impact Client applications with following conditions can be affected. - logs error message from this module - or returns error message to client as something like HTTP response. - or uses error messages somewhere

CVE-2024-35232 Affected Github.com/huandu/facebook/v2 Versions

1 component(s)
Fixed Versions:
2.7.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/huandu/facebook/v2
Go
< 2.7.2
2.7.2

References

Frequently Asked Questions

What is CVE-2024-35232?
CVE-2024-35232 is a security vulnerability in Github.com/huandu/facebook/v2 involving github.com/huandu/facebook may expose access_token in error message. under CWE-209: Generation of Error Message Containing Sensitive Information.
Which Github.com/huandu/facebook/v2 versions are affected?
Affected versions include releases prior to 2.7.2 across affected packages: github.com/huandu/facebook/v2.
What version fixes CVE-2024-35232?
Upgrading to 2.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/huandu/facebook/v2 affected?
Yes, github.com/huandu/facebook/v2 is affected in releases prior to 2.7.2. Upgrade your dependency to 2.7.2 or later.
What is the CVSS score of CVE-2024-35232?
CVE-2024-35232 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2024-35232?
CVE-2024-35232 is classified under CWE-209: Generation of Error Message Containing Sensitive Information (The product generates an error message that includes sensitive information about its environment, users, or associated data.).
How can I check Go dependencies for CVE-2024-35232?
Run the dependency tree command: 'inspect dependencies for github.com/huandu/facebook/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3f65-m234-9mxr",
  "modified" : "2024-05-29T20:43:59Z",
  "published" : "2024-05-24T20:19:53Z",
  "aliases" : [ "CVE-2024-35232" ],
  "summary" : "github.com/huandu/facebook may expose access_token in error message.",
  "details" : "### Summary\naccess_token can be exposed in error message on fail in HTTP request.\n\n### Details\nUsing this module, when HTTP request fails, error message can contain access_token. This can be happen when:\n- module is sending HTTP request with query parameter `?access_token=...`.\n- and HTTP request fails (errors like `facebook: cannot reach facebook server`).\n\nIn such situation, error message is constucted like following.\nhttps://github.com/huandu/facebook/blob/1591be276561bbdb019c0279f1d33cb18a650e1b/session.go#L558-L567\nOriginal error message contained in it comes from `net/http` module. And it can contain full URL, that can contain query parameter `access_token`:\nhttps://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/http/client.go;l=629-633\nhttps://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/url/url.go;l=30\n\nIt should be very common that applications log error message when they encounter errors. As a result, access_token can be stored into log server and some other infrastructures. Of course other careless error handling in client code that causing other security problems can exist.\n\nI'm not very sure that whether we can consider that github.com/huandu/facebook is vulnerable. Anyway, I think current error message, that can expose access_token, is not desirble.\n\n### PoC\nRequest me this section if you need complete instruction.\n\n### Impact\nClient applications with following conditions can be affected.\n- logs error message from this module\n- or returns error message to client as something like HTTP response.\n- or uses error messages somewhere\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/huandu/facebook/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.7.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.7.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/huandu/facebook/security/advisories/GHSA-3f65-m234-9mxr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35232"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huandu/facebook/commit/8b34431b91b32903c8821b1d7621bf81a029d8e4"
  }, {
    "type" : "WEB",
    "url" : "https://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/http/client.go;l=629-633"
  }, {
    "type" : "WEB",
    "url" : "https://cs.opensource.google/go/go/+/refs/tags/go1.22.3:src/net/url/url.go;l=30"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/huandu/facebook"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/huandu/facebook/blob/1591be276561bbdb019c0279f1d33cb18a650e1b/session.go#L558-L567"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-209" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-05-24T20:19:53Z",
    "nvd_published_at" : "2024-05-24T21:15:59Z"
  }
}