Issues (76)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Entity/Account.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Baguette\Mastodon\Entity;
4
5
/**
6
 * Account
7
 *
8
 * @author    USAMI Kenta <[email protected]>
9
 * @copyright 2017 Baguette HQ
10
 * @license   https://www.gnu.org/licenses/gpl-3.0.html GPL-3.0
11
 * @see https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md#account
12
 * @property-read int    $id           The ID of the account
13
 * @property-read string $username     The username of the account
14
 * @property-read string $acct         Equals username for local users, includes @domain for remote ones
15
 * @property-read string $display_name The account's display name
16
 * @property-read bool   $locked       Boolean for when the account cannot be followed without waiting for approval first
17
 * @property-read \DateTimeImmutable $created_at The time the account was created
18
 * @property-read int    $followers_count The number of followers for the account
19
 * @property-read int    $following_count The number of accounts the given account is following
20
 * @property-read int    $statuses_count  The number of statuses the account has made
21
 * @property-read string $note Biography of user
22
 * @property-read string $url  URL of the user's profile page (can be remote)
23
 * @property-read string $avatar        URL to the avatar image
24
 * @property-read string $avatar_static URL to the avatar static image (gif)
25
 * @property-read string $header        URL to the header image
26
 * @property-read string $header_static URL to the header static image (gif)
27
 */
28
class Account extends Entity
29
{
30
    use \Teto\Object\TypedProperty;
31
32
    private static $property_types = [
0 ignored issues
show
The property $property_types is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
33
        'id'              => 'int',
34
        'username'        => 'string',
35
        'acct'            => 'string',
36
        'display_name'    => 'string',
37
        'locked'          => 'bool',
38
        'created_at'      => \DateTimeImmutable::class,
39
        'followers_count' => 'int',
40
        'following_count' => 'int',
41
        'statuses_count'  => 'int',
42
        'note'            => 'string',
43
        'url'             => 'string',
44
        'avatar'          => 'string',
45
        'avatar_static'   => 'string',
46
        'header'          => 'string',
47
        'header_static'   => 'string',
48
    ];
49
50 3
    public function __construct(array $properties)
51
    {
52 3
        $this->setProperties(mapValues($properties, [
53 3
            'created_at' => \DateTimeImmutable::class,
54
        ]));
55 3
    }
56
57
    /**
58
     * Returns account data as array
59
     *
60
     * @return array
61
     */
62 4
    public function toArray()
63
    {
64
        return [
65 4
            'id'              => $this->id,
66 4
            'username'        => $this->username,
67 4
            'acct'            => $this->acct,
68 4
            'display_name'    => $this->display_name,
69 4
            'locked'          => $this->locked,
70 4
            'created_at'      => toArrayValue($this->created_at),
71 4
            'followers_count' => $this->followers_count,
72 4
            'following_count' => $this->following_count,
73 4
            'statuses_count'  => $this->statuses_count,
74 4
            'note'            => $this->note,
75 4
            'url'             => $this->url,
76 4
            'avatar'          => $this->avatar,
77 4
            'avatar_static'   => $this->avatar_static,
78 4
            'header'          => $this->header,
79 4
            'header_static'   => $this->header_static,
80
        ];
81
    }
82
}
83