Skip to content

File System Security Issue in Custom Auth Article #5845

Closed
@mattjanssen

Description

@mattjanssen

https://github.com/symfony/symfony-docs/blob/master/cookbook/security/custom_authentication_provider.rst#the-listener

Security concern: If $token->nonce is set to [ANY USER INPUT] and later we run file_put_contents($token->nonce, time()) are we allowing hackers to destroy any www-writable file in the system?

I did notice that $nonce is run through base64_decode($nonce). Could this Regex be updated to only accept a Base64 string [a-zA-Z+/]+={0,2} for the nonce?

Metadata

Metadata

Assignees

No one assigned

    Labels

    SecurityhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions