Skip to content

Wrong URL path formation at variable edition/deleting #2815

@appsec-igm-sbf

Description

@appsec-igm-sbf

https://github.com/PyGithub/PyGithub/blob/dc37d5c1852a1c2f7083118adeda22760d575420/github/Variable.py#L99C25-L99C55

Description:

The self.url is already actions/variables/{variable_name} and does not need to repeat the path as it is in the code.

Evidences:

Malformed URL:
PATCH https://api.github.com/repos/grupo-sbf/pci-api/actions/variables/CX_ADDITIONAL_PARAMETERS/actions/variables/CX_ADDITIONAL_PARAMETERS

{ "headers": { "Authorization": "token (oauth token removed)", "User-Agent": "PyGithub/Python", "Content-Type": "application/json" }, "data": { "name": "CX_ADDITIONAL_PARAMETERS", "value": "oie" }, "status": 404, "responseHeaders": { "server": "GitHub.com", "date": "Fri, 10 Nov 2023 16:12:00 GMT", "content-type": "application/json; charset=utf-8", "transfer-encoding": "chunked", "x-oauth-scopes": "admin:org_hook, codespace, project, read:discussion, read:org, read:packages, read:user, repo, user:email, workflow", "x-accepted-oauth-scopes": "repo", "github-authentication-token-expiration": "2023-12-01 13:25:29 UTC", "x-github-media-type": "github.v3; format=json", "x-github-api-version-selected": "2022-11-28", "x-ratelimit-limit": "5000", "x-ratelimit-remaining": "4973", "x-ratelimit-reset": "1699635340", "x-ratelimit-used": "27", "x-ratelimit-resource": "core", "access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset", "access-control-allow-origin": "*", "strict-transport-security": "max-age=31536000; includeSubdomains; preload", "x-frame-options": "deny", "x-content-type-options": "nosniff", "x-xss-protection": "0", "referrer-policy": "origin-when-cross-origin, strict-origin-when-cross-origin", "content-security-policy": "default-src 'none'", "vary": "Accept-Encoding, Accept, X-Requested-With", "content-encoding": "gzip", "x-github-request-id": "20B6:21F720:12149D6:1368BCF:654E5650" }, "error": { "message": "Not Found", "documentation_url": "https://docs.github.com/rest" } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions