Skip to content

Instantly share code, notes, and snippets.

View mfakhrusy's full-sized avatar
😄
Hi!

M Fahru mfakhrusy

😄
Hi!
View GitHub Profile

I'll analyze this Flask authentication code for security vulnerabilities. This is a comprehensive review without needing external tools. Security Assessment: Moderate Risk ⚠️

This code has several good security practices but also contains critical vulnerabilities that would make it unsafe for production use.

🔴 Critical Vulnerabilities

  1. Weak Password Hashing (SHA-256)
password_hash = hashlib.sha256((password + salt).encode()).hexdigest()
@mfakhrusy
mfakhrusy / kimi_post_login.md
Last active February 8, 2026 21:39
Kimi 2.5 result for "create a python post request handler of a login form" prompt

I'll create a Python POST request handler for a login form. This will be a complete, production-ready example using Flask with security best practices.

from flask import Flask, request, jsonify, make_response
from functools import wraps
import re
import hashlib
import secrets
import time
CREATE OR REPLACE FUNCTION public.document_count_categories()
RETURNS TABLE(output_ancestor_name text, output_all_document numeric, output_verified_document numeric, output_revision_document numeric)
LANGUAGE plpgsql
AS $function$
declare
parent_category_id UUID;
begin
FOR parent_category_id IN
SELECT category_id FROM categories where parent_id is null
LOOP
with recursive category_tree AS (
select category_id, "name", ARRAY[]::UUID[] AS ancestors
from categories WHERE parent_id IS NULL
union all
select categories.category_id, categories."name", category_tree.ancestors || categories.parent_id
from categories, category_tree
where categories.parent_id = category_tree.category_id
), document_count_per_sub_category as (
select
d.document_name as "name",
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
==> Making package: silo 4.10.2-6 (Sun Mar 5 10:38:03 WIB 2017)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found silo-4.10.2.tar.gz
-> Found silo-4.10.2-rocket-test.patch
-> Found silo-4.10.2-skip-test.patch
-> Found silo-4.10.2-remove-mpiposix.patch
==> Validating source files with sha256sums...
silo-4.10.2.tar.gz ... Passed